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.
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.
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.
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.