lyst / lightfm

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

How to add a new user or item to the model ? #564

Open johannbuscail opened 3 years ago

johannbuscail commented 3 years ago

Hi @maciejkula. First: This library is amazing Second: I would like to know how to add a user to the model. It's easy to add the user to the interaction matrix:

 interactions.loc[user_id] = 0

But do I need to fit the model with all the interactions or only the new one:

# this 
x = sparse.csr_matrix(interactions.loc[user].values)
# or this
x = sparse.csr_matrix(interactions)
model.fit(interactions=x, epochs=epoch, num_threads=n_jobs)
yo-png commented 3 years ago

I was asking myself the same question