这是indexloc提供的服务,不要输入任何密码
Skip to content

Something wrong about the calculation of precision and recall #113

@WinChua

Description

@WinChua

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions