recommenders-team/recommenders

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

Aperta

#2140 aperta il 10 ago 2024

 (2 commenti) (0 reazioni) (0 assegnatari)Python (3319 fork)batch import
help wanted

Metriche repository

Star
 (21.866 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor