lyst / lyst/lightfm

Getting same recommendation when using user features

Open
#497 9 comments 3 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.1k
Forks
724
PR merge metrics
No merged PRs in 30d

Description

Hello!

I'm building a recommendation system, and I'm having a similar problem to Issue #320, and I can't seem to find what is wrong.

Particularly, I trained my model twice: once without using user features and the other time using them. When I don't use them, I get decent recommendations for every user. Many of them are very similar due to the nature of my data (a few items are very popular among users), but overall recommendations look fine.

I would like then to include user features to personalize even more recommendations. However, when I do it, I get almost the same prediction for every user. These predictions look even more similar than when I don't use user features.

The way I'm using user features is the following:

First I give lightfm the user features' names in the dataset fit function:

`dataset.fit((data['user_index']),
(data['item_index']), user_features=user_features_names)`

I then build a user featues list, where the first element is the user id and the second element is a list containing the values of the features for that user:

`(user_1, [feature_1, feature_2,..., feature_n])`
`(user_2, [feature_1, feature_2,..., feature_n])`

I build the user features using this as an input for the `build_user_features` function and the train and predict with my model.

I am using only categorical variables (one hot encoded) since I got an error when trying to pass continuous variables to lightfm in this way. I also did a random search to find the best hyperparameters to train the model, and find a little improvement but nothing significant (still almost same prediction for every user).

Is there somehting I'm doing wrong? I would really appreciate any help!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the behavior described around dataset.fit, build_user_features, and the train-and-predict flow, then compare it with the related Issue #320. Reproduce the difference between models with and without user features using the reported categorical inputs. Done means determining whether the reported similarity is an input or usage issue, or a reproducible LightFM defect with a minimal example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.