lightfm icon indicating copy to clipboard operation
lightfm copied to clipboard

Recommender System with RFM ratings to put into Interaction matrix

Open rajatrautela opened this issue 1 year ago • 9 comments

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.

rajatrautela avatar Jun 09 '23 09:06 rajatrautela

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 ?

Natsuhadder avatar Jun 09 '23 10:06 Natsuhadder

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?

rajatrautela avatar Jun 09 '23 10:06 rajatrautela

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 ?

Natsuhadder avatar Jun 09 '23 10:06 Natsuhadder

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

rajatrautela avatar Jun 09 '23 10:06 rajatrautela

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

rajatrautela avatar Jun 09 '23 10:06 rajatrautela

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.

Natsuhadder avatar Jun 09 '23 10:06 Natsuhadder

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.

rajatrautela avatar Jun 09 '23 10:06 rajatrautela

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.

Natsuhadder avatar Jun 09 '23 10:06 Natsuhadder

Alright. Thank you so much for the help :)

rajatrautela avatar Jun 09 '23 10:06 rajatrautela