lyst / lightfm

A Python implementation of LightFM, a hybrid recommendation algorithm.
Apache License 2.0
4.77k stars 691 forks source link

Deleting user or product from a pretrained model #558

Open sgaseretto opened 4 years ago

sgaseretto commented 4 years ago

How can this be done with LightFM? Imagine you have a very good model already trained, and you discontinue a large group of products, and also some of your users deleted their accounts. How can this user and items representations be deleted from the model in order to avoid having to train a new model without them?

johannbuscail commented 4 years ago

@sgaseretto Have you found an answer ? I'm facing the same issue

lkurlandski commented 4 years ago

Within predict, you pass in the item ids that you want included to get predictions for. I would suggest creating a function that returns only item ids that are still in the system, and using this to filter which items you get prediction for. For example: predictions = predict(user_ids=1, item_ids=items_in_system_right_now())