Back to models
Splitter

InstanceSplitter

Splitter that applies an sklearn instance splitter to a panel of time series.

For splitter cv, applies cv to the instance index of y. The instance index are all levels of a hierarchical or panel index, except the last, temporal one.

Returned split iloc and loc indices are in reference to the original y, not the instance index.

Quickstart

python
from sktime.split.instance import InstanceSplitter

estimator = InstanceSplitter(cv)

Parameters(1)

cvsklearn splitter
splitter for the instance index

Examples

>>> from sktime.split import InstanceSplitter
>>> from sktime.utils._testing.hierarchical import _make_hierarchical
>>> from sklearn.model_selection import KFold
>>> 
>>> y = _make_hierarchical ()
>>> splitter = InstanceSplitter (KFold (n_splits = 3))
>>> list (splitter. split (y))