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

[BUG] relevancy method and get_top_k with threshold discussion #1041

Open
miguelgfierro opened this issue Jan 23, 2020 · 0 comments
Open

[BUG] relevancy method and get_top_k with threshold discussion #1041

miguelgfierro opened this issue Jan 23, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@miguelgfierro
Copy link
Collaborator

Description

@anargyri, @loomlike and I were having a discussion about how to optimize surprise prediction, and we saw that in the function merge_ranking_true_pred there is this code:

    if relevancy_method == "top_k":
        top_k = k
    elif relevancy_method == "by_threshold":
        top_k = threshold
    else:
        raise NotImplementedError("Invalid relevancy_method")
    df_hit = get_top_k_items(
        dataframe=rating_pred_common,
        col_user=col_user,
        col_rating=col_prediction,
        k=top_k,
    )

so the input to get_top_k_items is a number, but not the relevancy method. In that function we have:

    top_k_items = (
        dataframe.groupby(col_user, as_index=False)
        .apply(lambda x: x.nlargest(k, col_rating))
        .reset_index(drop=True)
    )

@yueguoguo are we using the threshold somewhere?

In which platform does it happen?

How do we replicate the issue?

Expected behavior (i.e. solution)

Other Comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant