What is the purpose of the gap parameter in TimeSeriesSplit?
Correct answer
C. It drops samples between train and test to avoid leakage from overlap
41 views
C. It drops samples between train and test to avoid leakage from overlap
41 views
TimeSeriesSplit never shuffles: each fold trains on the past and tests on the future, so the training window always precedes the test window. The gap parameter removes the last few training samples before each test block, which matters when features are built from rolling windows that would otherwise overlap the test period. It does not create extra folds; n_splits controls the number of splits.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is C? Ask here and get an explanation.