etna.experimental.classification.feature_extraction.TSFreshFeatureExtractor#

class TSFreshFeatureExtractor(default_fc_parameters: dict | None = None, fill_na_value: float = -100, n_jobs: int = 1, **kwargs)[source]#

Bases: BaseTimeSeriesFeatureExtractor

Class to hold tsfresh features extraction from tsfresh.

Note

This class requires classification extension to be installed. Read more about this at installation page.

Init TSFreshFeatureExtractor with given parameters.

Parameters:
  • default_fc_parameters (dict | None) – Dict with names of features. .. Examples: blue-yonder/tsfresh

  • fill_na_value (float) – Value to fill the NaNs in the resulting dataframe.

  • n_jobs (int) – The number of processes to use for parallelization.

Methods

dump(path, *args, **kwargs)

Save the object.

fit(x[, y])

Fit the feature extractor.

fit_transform(x[, y])

Fit the feature extractor and extract features from the input data.

load(path, *args, **kwargs)

Load the object.

set_params(**params)

Return new object instance with modified parameters.

to_dict()

Collect all information about etna object in dict.

transform(x)

Extract tsfresh features from the input data.

Attributes

This class stores its __init__ parameters as attributes.

dump(path: str, *args, **kwargs)[source]#

Save the object.

Parameters:

path (str) –

fit(x: List[ndarray], y: ndarray | None = None) TSFreshFeatureExtractor[source]#

Fit the feature extractor.

Parameters:
Return type:

TSFreshFeatureExtractor

fit_transform(x: List[ndarray], y: ndarray | None = None) ndarray[source]#

Fit the feature extractor and extract features from the input data.

Parameters:
  • x (List[ndarray]) – Array with time series.

  • y (ndarray | None) – Array of class labels.

Returns:

Transformed input data.

Return type:

ndarray

static load(path: str, *args, **kwargs)[source]#

Load the object.

Warning

This method uses dill module which is not secure. It is possible to construct malicious data which will execute arbitrary code during loading. Never load data that could have come from an untrusted source, or that could have been tampered with.

Parameters:

path (str) –

set_params(**params: dict) Self[source]#

Return new object instance with modified parameters.

Method also allows to change parameters of nested objects within the current object. For example, it is possible to change parameters of a model in a Pipeline.

Nested parameters are expected to be in a <component_1>.<...>.<parameter> form, where components are separated by a dot.

Parameters:

**params (dict) – Estimator parameters

Returns:

New instance with changed parameters

Return type:

Self

Examples

>>> from etna.pipeline import Pipeline
>>> from etna.models import NaiveModel
>>> from etna.transforms import AddConstTransform
>>> model = NaiveModel(lag=1)
>>> transforms = [AddConstTransform(in_column="target", value=1)]
>>> pipeline = Pipeline(model, transforms=transforms, horizon=3)
>>> pipeline.set_params(**{"model.lag": 3, "transforms.0.value": 2})
Pipeline(model = NaiveModel(lag = 3, ), transforms = [AddConstTransform(in_column = 'target', value = 2, inplace = True, out_column = None, )], horizon = 3, )
to_dict()[source]#

Collect all information about etna object in dict.

transform(x: List[ndarray]) ndarray[source]#

Extract tsfresh features from the input data.

Parameters:

x (List[ndarray]) – Array with time series.

Returns:

Transformed input data.

Return type:

ndarray