Before and after arguments#

The before and after Span arguments determine how much data is included in the Data (given by before) and Future data (given by after) ranges of each fold.

Argument type

Interpretation

Example

String 'all'

Include all data before/after the scheduled time. Similar to sklearn.model_selection.TimeSeriesSplit(max_train_size=None)

Cron schedule, keeping all data before the schedule.

String 'empty'

Used to discard datasets. Sets the edge equal the the midpoint, e.g. after="empty" will set mid == end, discarding the Future data.

No future data

int > 0

Include all data within N schedule periods from the scheduled time.

Removing folds with n_splits. Schedule-based before and after-data.

Anything else

Passed as-is to the pandas.Timedelta class. Must be positive. See Offset aliases for valid frequency strings.

Timedelta-based schedule and after arguments.

See also

The Examples page.