Data Splitting#

The lenskit.splitting package implements data splitting support for evaluation.

Output Types#

TTSplit(train, test)

A train-test set from splitting or other sources.

User-Based Splitting#

crossfold_users

Partition a frame of ratings or other data into train-test partitions user-by-user.

sample_users

Create train-test splits by sampling users.

LastFrac

Select a fraction of test rows per user/item.

LastN

Select a fixed number of test rows per user/item, based on ordering by a field.

SampleFrac

Randomly select a fraction of test rows per user/item.

SampleN

Randomly select a fixed number of test rows per user/item.

Record-Based Splitting#

crossfold_records

Partition a dataset by records into cross-fold partitions.

sample_records

Sample train-test a frame of ratings into train-test partitions.