Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add recall metric #209

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LukasWestholt
Copy link

@LukasWestholt LukasWestholt commented Oct 4, 2024

See #138

I didn't test it.

query.expected_result
) # 1 means that all expected elements are in the results.

return precision, recall, end - start
Copy link
Contributor

@SebanDan SebanDan Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe returning a data structure for all metrics for instance : { "precision":.., "recall":... } might be more suitable and flexible as it do not change the output of the function everytime a new metric is added. Also, it seems that here, precision and recall are the same.``

Copy link

@jonbesga jonbesga Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking into account that in line 39 we have

            top = (
                len(query.expected_result)
                if query.expected_result is not None and len(query.expected_result) > 0
                else DEFAULT_TOP
            )

Is there any difference in recall and precision if top is not specified?

precision = (
true_positives / top
) # 1 means that the results consist of expected elements.
recall = true_positives / len(
Copy link

@jonbesga jonbesga Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formula for recall is correct but I wonder how useful it is when we are doing a top-k search.

If we specify top=5 and there are 100 neighbors in query.expected_result. The recall will always be at most 0.05 which doesn't seem to be a useful metric?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants