lenskit.splitting.TTSplit#

class lenskit.splitting.TTSplit(train, test)#

Bases: Generic[TK]

A train-test set from splitting or other sources.

Parameters:
__init__(train, test)#
Parameters:
Return type:

None

Methods

__init__(train, test)

from_src_and_test(src, test)

Create a split by subtracting test data from a source dataset.

Attributes

test_df

Get the test data as a data frame.

test_size

Get the number of test pairs.

train_df

Get the training data as a data frame.

train

The training data.

test

The test data.

train: Dataset#

The training data.

test: ItemListCollection[TK]#

The test data.

property test_size: int#

Get the number of test pairs.

property test_df: DataFrame#

Get the test data as a data frame.

property train_df: DataFrame#

Get the training data as a data frame.

classmethod from_src_and_test(src, test)#

Create a split by subtracting test data from a source dataset.

Parameters:
Return type:

TTSplit[TK]