lyst / lightfm

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

Creating recommendations for single users without leveraging user identity features #708

Open ninahua opened 2 months ago

ninahua commented 2 months ago

Hello,

I am creating recommendations for a single user with a model that was trained with user features but without user identity features (i.e. have set user_identity_features = False when creating the Dataset class). However, I encountered a shape issue when the method _construct_feature_matrices is called in the predict method. I noticed that the mismatch in shape was caused by this line (Line 851) in the predict method: n_users = user_ids.max() + 1

From what I can understand, user_ids is an array as long as the number of items but every element is the index value of a user (if a single user id is provided). However, shouldn't it be the number of users if user_features is provided?

Thanks ahead.