-
Notifications
You must be signed in to change notification settings - Fork 372
Open
Description
crab/scikits/crab/metrics/metrics.py
Lines 319 to 323 in beb3555
| precision[i] = (intersection_size / float(len(y_real[i]))) \ | |
| if len(y_real[i]) else 0.0 | |
| recall[i] = (intersection_size / float(len(y_items_pred))) \ | |
| if len(y_items_pred) else 0.0 | |
I doubt that the calculation of precision and recall is wrong.
The definition of precision is the proportion of the recommendation list (the y_pred) which is contained in the true list(the y_real).
So, I think the calculation of precision should be
precision[i] = (intersection_size / float(len(y_items_pred)))
if len(y_items_pred) else 0.0
and similarly, the calculation of recall should be
recall[i] = (intersection_size / float(len(y_real[i])))
if len(y_real[i]) else 0.0
Metadata
Metadata
Assignees
Labels
No labels