lyst / lyst/lightfm

Dividing data into train/test based on Time

Open
#657 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.1k
Forks
724
PR merge metrics
No merged PRs in 30d

Description

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:

- Test set is a sparse matrix of all the data
- Training set is a sparse matrix of all the data as of time _t_, with all data after _t_ set to _x_ where _x_ is whatever a non interaction is. So if my data is 1 for "customer bought product" and 0 for "customer has never bought product" then set data > _t_ as 0.

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the precision_at_k and auc_score entry points and how train_interactions and test_interactions are consumed. Determine whether temporally filtered sparse matrices are supported as described; done means the desired time-based train/test evaluation behavior is clearly supported or its limitations are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.