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

Request for Modification: filter_triplets Function #18

Open
Juniork725 opened this issue Jan 31, 2024 · 0 comments
Open

Request for Modification: filter_triplets Function #18

Juniork725 opened this issue Jan 31, 2024 · 0 comments

Comments

@Juniork725
Copy link

I am proposing a modification to the filter_triplets function.

The proposed modification is to change:

    if min_sc > 0:
        itemcount = get_count(tp, 'movieId')
        tp = tp[tp['movieId'].isin(itemcount.index[itemcount >= min_sc])]
    if min_uc > 0:
        usercount = get_count(tp, 'userId')
        tp = tp[tp['userId'].isin(usercount.index[usercount >= min_uc])]

to:

    if min_sc > 0:
        itemcount = get_count(tp, 'movieId')
        tp = tp[tp['movieId'].isin(itemcount[itemcount >= min_sc]['movieId'])]  # Modified

    if min_uc > 0:
        usercount = get_count(tp, 'userId')
        tp = tp[tp['userId'].isin(usercount[usercount >= min_uc]['userId'])]  # Modified

The reason for this change is that 'movieId' and 'userId' values may not align perfectly with the index due to possible gaps or mismatches.

Thank you for considering this adjustment.

Best regards,
JunHyuck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant