Transformer
PaddingTransformer
Padding panel of unequal length time series to equal, fixed length.
Pads the input dataset to either a optional fixed length (longer than the longest series). Or finds the max length series across all series and dimensions and pads to that with zeroes.
Schnellstart
python
from sktime.transformations.padder import PaddingTransformer
estimator = PaddingTransformer(pad_length=None, fill_value=0)Tags
Fähigkeiten
- Multivariat
- Reihen ungleicher Länge
- Gleicht Reihenlängen an: Unterstützt
- Inverse Transformation: Nicht unterstützt
- Fehlende Werte: Nicht unterstützt
- Entfernt fehlende Werte: 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)
- pad_lengthint, optional (default=None) length to pad the series too.
- if None, will find the longest sequence and use instead.
Beispiele
>>> import pandas as pd
>>> from sktime.transformations.padder import PaddingTransformer
>>>
>>> # Create a sample nested DataFrame with unequal length time series
>>> data = {
... 'feature1': [
... pd. Series ([1, 2, 3 ]), pd. Series ([4, 5 ]), pd. Series ([6, 7, 8, 9 ])
... ],
... 'feature2': [
... pd. Series ([10, 11 ]), pd. Series ([12, 13, 14 ]), pd. Series ([15 ])
... ]
... }
>>> X = pd. DataFrame (data)
>>>
>>> # Initialize the PaddingTransformer
>>> padder = PaddingTransformer ()
>>>
>>> # Fit the transformer to the data
>>> padder. fit (X) PaddingTransformer()
>>>
>>> # Transform the data
>>> Xt = padder. transform (X)
>>>
>>> # Display the transformed data
>>> # print(Xt)