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

Optimization the base _filter_seen method #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

netang
Copy link
Contributor

@netang netang commented Mar 20, 2023

Removed redundant steps in base _filter_seen method.

@monkey0head monkey0head self-requested a review March 22, 2023 12:23
@@ -457,33 +456,6 @@ def _filter_seen(
"""
users_log = log.join(users, on="user_idx")
self._cache_model_temp_view(users_log, "filter_seen_users_log")
num_seen = users_log.groupBy("user_idx").agg(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t seems those steps are not redundant.
some models (a lot of models) do not filter seen items inside _predict(). So if we want to predict with filter_seen_items=True, we

  1. predict more items than needed (k + max_seen),
  2. filter out seed items (thus we will get number of recommendations in interval [k, k + max_seen]
  3. get top-k most relevant

So, ether you placed seen filtering inside _predict method of each model and it is not in the current pr, or you just removed some necessary functionality. Lets discuss

@monkey0head monkey0head added the question Further information is requested label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants