lyst / lightfm

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

Dividing data into train/test based on Time #657

Open Richie-Peak opened 2 years ago

Richie-Peak commented 2 years ago

Firstly, thank you so much for making a great package!

Currently LightFM cannot divide data into train/test temporally, i.e. "train on all data except last 6 months, test on data from last 6 months". If I wrote this, would it simply be a case of:

Then it would fit into LightFM's precision_at_k and auc_score() functions, as you could pass train and test to train_interactions and test_interactions respectively?

EdwardALockhart commented 1 year ago

I think I have a solution for you. Look at my code here.

https://github.com/lyst/lightfm/issues/663