Ben Frederickson
Ben Frederickson
The best example I have is probably in the unittest here https://github.com/benfred/implicit/blob/cb2a66d50d1f1c2779108724c78f7653024332b8/tests/als_test.py#L272-L301
This isn't possible with the BPR model right now - this functionality is only in the ALS model
I don't think the `recommend` call is broken for MF models. We've changed the API in https://github.com/benfred/implicit/issues/481 - and it seems like the change that is tripping you up is...
The `recommend` methods in implicit should return ids sorted by their scores - so I don't think this is a problem Are you seeing instances where models aren't returning ids...
>For real-time, load the saved(pickle) model, get the latest interactions in the last 5 mins, use partial_fit_users and partial_fit_items method to incrementally train on the new data. For the partial_fit_items/users...
Yeah - thats a great callout. The datasets were generated before the API refactor in #481 - and we really should generate new ones with transposed data.
I think your issue is here: ```python data_conf = (item_user_sparse1 * alpha_val).astype('double') model1.fit(data_conf) model1.recommend(0,user_item_sparse1[0]) ``` The `fit` methods take a user_item sparse matrix , https://benfred.github.io/implicit/api/models/cpu/als.html#implicit.cpu.als.AlternatingLeastSquares.fit instead of the item_user sparse...
I wrote a post talking about why py-spy has blocking as the default here https://www.benfrederickson.com/why-python-needs-paused-during-profiling/ - nonblocking is great for reducing perf impact, but can have very misleading results
Are you running in a docker container? If you're not in docker - does running this as `sudo` get over the permissions issue?