lenskit.splitting.TTSplit#

class lenskit.splitting.TTSplit#

A train-test set from splitting or other sources.

Changed in version 2026.1: Added the test_requests property.

Stability:
Caller (see Stability Levels).
train: lenskit.data.Dataset#

The training data.

test: lenskit.data.ItemListCollection#

The test data.

name: str | None = None#

A name for this train-test split.

property test_size: int#

Get the number of test pairs.

Return type:

int

property test_df: pandas.DataFrame#

Get the test data as a data frame.

Return type:

pandas.DataFrame

property train_df: pandas.DataFrame#

Get the training data as a data frame.

Return type:

pandas.DataFrame

property test_requests: lenskit.batch.TestRequestAdapter#

Get the test data as a sequence of batch recommendation requests.

See also

Batch Queries

Returns:

An collection that iterates over recommendation requests derived from the test data.

Return type:

lenskit.batch.TestRequestAdapter