lyst / lightfm

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

how interactions are defined? #561

Open ynorouzz opened 3 years ago

ynorouzz commented 3 years ago

We have users and deals that they are booked. So if booking considered as interaction, then how could we build the interactions? In some cases, deal are not booked by anyone, and in some cases, a user didn't book any deal. So the data look like as bellow guest_item_ids:

booking_id deal_id
100 200
100 201
101 NULL
NULL 202

Then if I replace NULLs with 0, I will get error Item id 0.0 not in item id mapping dataset.build_interactions(list(zip(guest_item_ids['booking_id'], guest_item_ids['deal_id'])))

maciejkula commented 3 years ago

If there is no interaction, just don't include it in the data.

ynorouzz commented 3 years ago

Ok. Thanks. Then how we could include the items that didn't had interactions in the list of recommend items?

igorkf commented 3 years ago

I think you can try to add user features or item features to the model, trying to avoid cold start problem.

jpan8866 commented 1 year ago

I am very new to lightFM and trying to understand how do we deal with items that do not have any interactions yet but are part of the catalogue of items I want to suggest to users? For example, deal_id does not have a booking yet, but I also do not want to remove it from the choices of deals? Is the following correct: Add it in Dataset.fit(), but leave it out of build_interactions(). I would subsequently add interactions for this item with LightFM.fit_partial()?