Back to models
Transformer

IndexSubset

Index subsetting transformer.

Quickstart

python
from sktime.transformations.subset import IndexSubset

estimator = IndexSubset(index_treatment='keep')

Parameters(1)

index_treatmentstr, optional, one of “keep” (default) or “remove”

determines which indices are kept in Xt = transform(X, y) “keep” = all indices in y also appear in Xt. If not present in X, NA is filled. “remove” = only indices that appear in both X and y are present in Xt.

Examples

>>> from sktime.transformations.subset import IndexSubset
>>> from sktime.datasets import load_airline
>>> X = load_airline ()[0: 32 ]
>>> y = load_airline ()[24: 42 ]
>>> transformer = IndexSubset ()
>>> X_subset = transformer. fit_transform (X = X, y = y)