Zurück zu den Modellen
Transformer

PandasTransformAdaptor

Adapt pandas transformations to sktime interface.

In transform, executes pd.DataFrame method of name method on data, optionally with keywords arguments passed, via kwargs hyper-parameter. The apply_to parameter controls what the data is upon which method is called: “call” = for X seen in transform, “all”/”all_subset” = all data seen so far. See below for details.

For hierarchical series, operation is applied by instance.

Schnellstart

python
from sktime.transformations.adapt import PandasTransformAdaptor

estimator = PandasTransformAdaptor(method, kwargs=None, apply_to='call')

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(3)

methodstr, optional, default = None = identity transform
name of the method of DataFrame that is applied in transform
kwargsdict, optional, default = empty dict (no kwargs passed to method)
arguments passed to DataFrame.method
apply_tostr, one of “call”, “all”, “all_subset”, optional, default = “call”

“call” = method is applied to X seen in transform only “all” = method is applied to all X seen in fit, update, transform

more precisely, the application to self._X is returned

“all_subset” = method is applied to all X like for “all” value,

but before returning, result is sub-set to indices of X in transform

Beispiele

>>> from sktime.transformations.adapt import PandasTransformAdaptor
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> transformer = PandasTransformAdaptor ("diff")
>>> y_hat = transformer. fit_transform (y)
>>> transformer = PandasTransformAdaptor ("diff", apply_to = "all_subset")
>>> y_hat = transformer. fit (y. iloc [: 12 ])
>>> y_hat = transformer. transform (y. iloc [12:])