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
I would like to know the best way to rank a handful of items for all my users, I currently have a huge number of users (around 5 million different users) and I need find the fastest way to rank 200 items to all of them.
Which is the best way to do this ?
calling the method rank_items() for each user sounds like a bad idea, I guess that there is a better factorized way to do this.
One solution could be implementing your own rank_item_all method with a custom C++ function filling numpy arrays in parallel, similar to recommend_all method.
One solution could be implementing your own rank_item_all method with a custom C++ function filling numpy arrays in parallel, similar to recommend_all method.
@mohjeih
Where can I get the recommend_all method written in C++ ? And where is the current "rank_items" method implemented ?
In order to have a guideline
@ManuelRios18 Sorry for the confusion. recommend_all and rank_items are implemented in recommender_base.pyx (Cythonized module). Please see here .recommend_all sorts array of scores in parallel using a C++ sorting function, fargsort_c, which is implemented in topnc.cpp. The wrapper to this sorting function is defined at the beginning of recommender_base.pyx.
Hi
I have the same problem as @ManuelRios18 (if you found a solution for this, please share)
Here is a code snippet from my project. Does somebody have another way to do this properly? Because this solution is taking a lot of time
Hello, Sadly I couldn't find an efficient solution, what I ended up doing was simply multiply user and item embeddings, load those results into my company's Landing Zone, and then I ranked the items using basic SQL queries.
@ManuelRios18 the latest main branch has support for this (though does have some breaking API changes ). see #481
model=implicit.als.AlternatingLeastSquares()
model.fit(user_items)
# rank the first 200 items in the model for all the usersuserids=np.arange(model.user_factors.shape[0])
items=np.arange(200)
ids, scores=model.recommend(userids, items=items)
Activity
mohjeih commentedon Aug 4, 2020
Hello,
One solution could be implementing your own
rank_item_allmethod with a custom C++ function filling numpy arrays in parallel, similar torecommend_allmethod.ManuelRios18 commentedon Aug 4, 2020
@mohjeih
Where can I get the recommend_all method written in C++ ? And where is the current "rank_items" method implemented ?
In order to have a guideline
mohjeih commentedon Aug 4, 2020
@ManuelRios18 Sorry for the confusion.
recommend_allandrank_itemsare implemented inrecommender_base.pyx(Cythonized module). Please see here .recommend_allsorts array of scores in parallel using a C++ sorting function,fargsort_c, which is implemented intopnc.cpp. The wrapper to this sorting function is defined at the beginning ofrecommender_base.pyx.marinkreso95 commentedon Apr 9, 2021
Hi
I have the same problem as @ManuelRios18 (if you found a solution for this, please share)
Here is a code snippet from my project. Does somebody have another way to do this properly? Because this solution is taking a lot of time
ManuelRios18 commentedon Apr 10, 2021
Hello, Sadly I couldn't find an efficient solution, what I ended up doing was simply multiply user and item embeddings, load those results into my company's Landing Zone, and then I ranked the items using basic SQL queries.
Happy coding!
@marinkreso95
benfred commentedon Jan 3, 2022
@ManuelRios18 the latest main branch has support for this (though does have some breaking API changes ). see #481