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

Something wrong about the calculation of precision and recall #113

Open
WinChua opened this issue Dec 6, 2017 · 0 comments
Open

Something wrong about the calculation of precision and recall #113

WinChua opened this issue Dec 6, 2017 · 0 comments

Comments

@WinChua
Copy link

WinChua commented Dec 6, 2017

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

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

No branches or pull requests

1 participant