You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before reading the source, I thought it was a whitelist of items that the recommendation should select from (which suited my usecase), but as it turns out, it is a blacklist. So, I have a two suggestions I'd like to hear your thoughts on:
Deprecate filter_items, and make a more descriptively named parameter such as skip_items, ignore_items, or item_blacklist.
Put an explanation in the docstrings: filter_items: A list of items that should not be recommended.
I would think the second one is a no-brainer - of course it should be documented. The first one, however, is a bit more bold. Thoughts?
As another remark (should I move it to another issue?), the line if filter_items:such as here doesn't work with numpy arrays. I would suggest moving to if filter_items is not None: instead.
Is it possible for the parameter filter_items to be added to the AlternatingLeastSquares.similar_items method, and a parameter named filter_users to be added to the AlternatingLeastSquares.similar_users method, so that the sent items and users are not returned?
Hello! Can you explain how filter_items works? When I pass a list with item indices in similar_items method I get these indices with -inf weight. It is not filtering really
Activity
benfred commentedon Jul 11, 2017
Thanks for the feedback! I totally agree - the documentation here has been lacking, and we should have full docstrings for all the methods.
I started on this a little today:64135cc .
These docs are hosted at http:///implicit.readthedocs.io/en/latest/. While the docs still need fleshing out, all the common methods and parameters are now documented.
I also agree that switching the filter_items logic to work with numpy arrays makes sense - I'll add that in soon.
thorbjornwolf commentedon Jul 11, 2017
Wow, very nice! This looks great :-) Thanks a bunch!
dminovski0 commentedon Oct 17, 2021
Is it possible for the parameter
filter_itemsto be added to theAlternatingLeastSquares.similar_itemsmethod, and a parameter namedfilter_usersto be added to theAlternatingLeastSquares.similar_usersmethod, so that the sent items and users are not returned?benfred commentedon Oct 17, 2021
@dminovski0 - thats a good suggestion! I'm trying to clean up the API here a bit, and I've added it to the list of tasks on #481
dminovski0 commentedon Oct 17, 2021
@benfred Thank you.
benfred commentedon Jan 3, 2022
#481 implements both the filter_items for similar_items/similar_users as well as working with numpy arrays.
P-Light commentedon Feb 13, 2024
Hello! Can you explain how filter_items works? When I pass a list with item indices in similar_items method I get these indices with -inf weight. It is not filtering really