lenskit.splitting.split_global_time#

lenskit.splitting.split_global_time(data: Dataset, time: str | datetime) TTSplit#
lenskit.splitting.split_global_time(data: Dataset, time: Sequence[str | datetime]) list[TTSplit]

Global temporal train-test split. This splits a data set into train/test pairs using a single global timestamp. When given multiple timestamps, it will return multiple splits, where split \(i\) has training data from before \(t_i\) and testing data on or after \(t_i\) and before \(t_{i+1}\) (the last split has no upper bound on the testing data).

Stability:
Caller (see Stability Levels).
Parameters:
  • data – The dataset to split.

  • time – Time or sequence of times at which to split. Strings must be in ISO format.

Returns:

The data splits.