-
Notifications
You must be signed in to change notification settings - Fork 90
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
base: master
Are you sure you want to change the base?
add recall metric #209
Conversation
for more information, see https://pre-commit.ci
query.expected_result | ||
) # 1 means that all expected elements are in the results. | ||
|
||
return precision, recall, end - start |
There was a problem hiding this comment.
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.``
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
See #138
I didn't test it.