benfred / implicit

Fast Python Collaborative Filtering for Implicit Feedback Datasets
https://benfred.github.io/implicit/
MIT License
3.52k stars 607 forks source link

Metadata filter for items #203

Open jaderabbit opened 5 years ago

jaderabbit commented 5 years ago

Would it be possible to include the ability to include and filter by additionally provided item metadata?

Use Case: Suppose one wants users interactions with all types of item to inform their recommendations with different types of items. However, on certain views, we'd like to extract the top N items of type X, versus the top N items of type Y.

ita9naiwa commented 5 years ago

There is rank_items method in recommenders.

https://github.com/benfred/implicit/blob/6b16c50d1d514a814f2e5b8cf2a829ff23dbba63/implicit/recommender_base.py#L60-L83

First filter out items and build the set of type X, then we can use it to recommend items from filtered itemset X.

I think it is hard to take item metadata as argument because item metadata have different characteristics and forms.(tags, images, text... almost everything is metadata).