Shuffled k-fold on time series trains on the future to predict the past. Time-series splits always train on earlier data and test on the block right after it.
Implement time_series_splits(n, n_splits, test_size=None, gap=0, max_train_size=None), matching scikit-learn's TimeSeriesSplit:
test_size defaults to n // (n_splits + 1).[start, start + test_size) with start = n - (n_splits - i) * test_size.[0, start - gap), keeping only the last max_train_size indices if that's set (a sliding window).(train, test) pairs of Python lists. Raise ValueError if any training set would be empty.Then implement check_no_leakage(splits): True if in every split all training indices are smaller than all test indices.