lenskit.splitting.split_global_time#
- lenskit.splitting.split_global_time(data: Dataset, time: int | float | str | datetime, end: int | float | str | datetime | None = None) TTSplit #
- lenskit.splitting.split_global_time(data: Dataset, time: Sequence[int | float | str | datetime], end: int | float | str | datetime | None = None) 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.
end – A final cutoff time for the testing data.
- Returns:
The data splits.