Accuracy¶
Accuracy metrics quantify how well a recommender system predicts user preferences or identifies relevant items. They assess the correctness of recommendations by comparing predicted interactions or ratings against actual user behavior. High accuracy generally indicates that the system is effective at surfacing items users are likely to engage with.
API Reference
For class signatures and source code, see the Accuracy Metrics API Reference.
AUC¶
Area Under the ROC Curve (AUC). Measures the probability that a randomly chosen relevant item is ranked higher than a randomly chosen irrelevant one.
For further details, please refer to this link.
F1¶
F1-Score (F1@K). The harmonic mean of Precision@K and Recall@K, providing a balanced measure of accuracy.
For further details, please refer to this book and this link.
Extended-F1 is also available, allowing you to compute the harmonic mean of any two metrics of your choice, as follows:
evaluation:
top_k: [10, 20, 50]
complex_metrics:
- name: F1
params:
metric_name_1: nDCG
metric_name_2: MAP
beta: 0.5
GAUC¶
Group Area Under the ROC Curve (GAUC). Computes AUC per user (or group), then averages the results; accounts for group-level ranking quality.
For further details, please refer to this paper.
HitRate¶
HitRate@K. Measures the percentage of users for whom at least one relevant item is found within the top K recommendations.
For further details, please refer to this link.
LAUC¶
Limited Area Under the ROC Curve (LAUC@K). AUC computed over a limited set of top-ranked items, focusing on ranking quality within the most relevant recommendations.
For further details, please refer to this paper.
MAP¶
Mean Average Precision (MAP@K). Measures the mean of average precision scores across all users, rewarding correct recommendations ranked higher.
For further details, please refer to this link.
MAR¶
Mean Average Recall (MAR@K). Measures the mean of average recall scores across all users, indicating how well the relevant items are retrieved on average.
For further details, please refer to this link.
MRR¶
Mean Reciprocal Rank (MRR@K). Measures the average of the reciprocal ranks of the first relevant item in the recommendations.
For further details, please refer to this link.
nDCG¶
Normalized Discounted Cumulative Gain (nDCG@K). Evaluates the ranking quality of recommendations, giving higher scores to relevant items appearing at higher ranks.
For further details, please refer to this link.
nDCGRendle2020 is also available, allowing you to compute nDCG on binary relevance.
For further details, please refer to this link.
Precision¶
Precision@K. Measures the proportion of recommended items at rank K that are actually relevant.
For further details, please refer to this link.
Recall¶
Recall@K. Measures the proportion of relevant items that are successfully recommended within the top K items.
For further details, please refer to this link.