Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommender System with RFM ratings to put into Interaction matrix #693

Open
rajatrautela opened this issue Jun 9, 2023 · 9 comments
Open

Comments

@rajatrautela
Copy link

I am trying to use LightFM for recommending the places to transact at.
I have used Recency, Frequency and Monetary (RFM) to calculate the interactions between a user and a shop.
I am putting these RFM interaction into Interaction matrix.
How do i go about in such a case?
I am using BPR loss function and have tried parameter tuning.
It gives good recall and AUC score here... But the issue is that the stores whose Interaction ratings are generally high... Are being recommended less. The actual life recall doesn't match.
Please help how to proceed if I am making any mistake in creating the interaction matrix.

@Natsuhadder
Copy link

Hello , have you tried to normalize your RFM scores in the interaction matrix or change the values of your hyperparameters to see if there are any improvements ?

@rajatrautela
Copy link
Author

The RFM scores were binned and I got ratings ranging from minimum 4 to maximum 18. Do you suggest I try to still normalize it into values in range 0 to 1?
I have tried changing the hyperparameters, didn't work.
However I also noticed that after predictions, the values I get for each interaction are negative. Is the negative value normal? Or is it due to some issue?

@Natsuhadder
Copy link

The negative scores that you get in the predictions are normal to be observed , but i think that's abnormal if u have all the scores negatives for all your prédictions. What is the loss function you are using ?

What concerns the question of normalization , i think that the model doesn't capture well the RFM scores as there are many values (14) , u can try to either normalize them to range in 0-1 , or create a sort of bins for ur values and give for each bin a value. Also it's weird that u don't have 0's in your interaction matrix , don't you have some users that have never interacted with a particular shop ?

@rajatrautela
Copy link
Author

For such users the interaction would be null, I assume.
Also, the loss function I used is BPR

@rajatrautela
Copy link
Author

I will try it using the normalization you suggested. Thanks. Hope it works.

@Natsuhadder
Copy link

You can try the WARP loss fucntion also if you want your already positive items to be ranked higher than negative items in the training process.

The interaction matrix in the Lightfm model doesn't handle null values, they are rather transformed into zero values.

@rajatrautela
Copy link
Author

When we put the interaction matrix, I was of the idea that these Null values would be filled in during prediction. Like in Collaborative filtering.
It's like I would like the non interacted shops to be recommended based on similarity with other users who have interacted with those shops.

@Natsuhadder
Copy link

Yes , i actually have the same problem , i would like to improve the lightfm class in order to support a non negative matrix factorization. But the current lightfm doesn't support this type of problematic.

@rajatrautela
Copy link
Author

Alright. Thank you so much for the help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants