Transformer
IndexSubset
Index subsetting transformer.
In transform, subsets X to the indices in y.index. If y is None, returns X without subsetting. numpy-based X are interpreted as having a RangeIndex starting at n, where n is the number of numpy rows seen so far through fit and update. Non-pandas types are interpreted as having index as after conversion to pandas, via datatypes.convert_to, to the "pd.DataFrame" sktime type.
Schnellstart
python
from sktime.transformations.subset import IndexSubset
estimator = IndexSubset(index_treatment='keep')Tags
Fähigkeiten
- Multivariat
- Reihen ungleicher Länge
- Inverse Transformation: Nicht unterstützt
- Fehlende Werte: Nicht unterstützt
- Entfernt fehlende Werte: Nicht unterstützt
- Gleicht Reihenlängen an: Nicht unterstützt
Eigenschaften
- Eingabetypscitype:transform-input
- Series
- Ausgabetypscitype:transform-output
- Series
- Label-Typscitype:transform-labels
- None
- Fit ist leerfit_is_empty
- Nein
- Behält den Zeitindextransform-returns-same-time-index
- Nein
- Benötigt Xrequires_X
- Ja
- Benötigt yrequires_y
- Nein
- X und y brauchen denselben IndexX-y-must-have-same-index
- Nein
Parameter(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.
Beispiele
>>> 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)