recommenders-team/recommenders

[ASK] Confusion between top_k and by_threshold relevancy_method in python_evaluation.py

Open

#2,140 创建于 2024年8月10日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Python (2,972 fork)batch import
help wanted

仓库指标

Star
 (17,706 star)
PR 合并指标
 (平均合并 6天 16小时) (30 天内合并 10 个 PR)

描述

Description

What is the different between k and threshold value here if they all get assigned to top_k? Isn't threshold supposed to be a rating value that the predictions should exceed instead of being the number of items in the top_k list ? Thanks.

def merge_ranking_true_pred(
    rating_true,
    rating_pred,
    col_user,
    col_item,
    col_prediction,
    relevancy_method,
    k=DEFAULT_K,
    threshold=DEFAULT_THRESHOLD,
    **_,
):
    if relevancy_method == "top_k":
        top_k = k
    elif relevancy_method == "by_threshold":
        top_k = threshold

Other Comments

贡献者指南