sktime.forecasting.model_selection.temporal_train_test_split

sktime.forecasting.model_selection.temporal_train_test_split(y, X=None, test_size=None, train_size=None, fh=None)[source]

Split arrays or matrices into sequential train and test subsets Creates train/test splits over endogenous arrays an optional exogenous arrays. This is a wrapper of scikit-learn’s train_test_split that does not shuffle.

Parameters
  • *series (sequence of pd.Series with same length / shape[0]) –

  • test_size (float, int or None, optional (default=None)) – If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the test split. If int, represents the relative number of test samples. If None, the value is set to the complement of the train size. If train_size is also None, it will be set to 0.25.

  • train_size (float, int, or None, (default=None)) – If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the train split. If int, represents the relative number of train samples. If None, the value is automatically set to the complement of the test size.

  • fh (ForecastingHorizon) –

Returns

splitting – List containing train-test split of inputs.

Return type

list, length=2 * len(arrays)

References

..[1] adapted from https://github.com/alkaline-ml/pmdarima/