Skip to content

SplitterSummarizer

SplitterSummarizer

class SplitterSummarizer(transformer, splitter=None, index='last', fit_on='transform_train', transform_on='transform_train')[source]

Create summary values of a time series’ splits.

A series-to-series transformer that applies the series-to-primitives transformer transformer to each train split created using the splitter splitter.

The i-th row of the resulting series is equivalent to transformer.fit(X_fit).transform(X_trafo), where X_fit and X_transform are obtained from the i-th split of splitter, as determined by the fit_on and transform_on parameters.

The output series aims to provide a summarization of the input series based on the given transformer and splitter.

Parameters:
transformersktime transformer inheriting from BaseTransformer

series-to-primitives transformer used to convert series to primitives.

splittersktime splitter inheriting from BaseSplitter, optional
(default=None)

splitter used to divide the series. If None, it takes ExpandingWindowSplitter with start_with_window=False and otherwise default parameters.

indexstr, optional (default=”last”)

Determines the indexing approach for the resulting series. If “last”, the latest index of the split is used. If anything else, the row’s number becomes the index.

fit_onstr, optional (default=”transform_train”)

What data to fit transformer on, for the i-th row of the resulting series.

  • “all_train” : transform the i-th train split obtained from splitter.split_series, called on all data seen in fit and update calls, plus all data seen in transform.

  • “all_test” : transform the i-th test split obtained from splitter.split_series, called on all data seen in fit and update calls, plus all data seen in transform.

  • “transform_train” : transform the i-th train split obtained from splitter.split_series, called on the data seen in transform.

  • “transform_test” : transform the i-th test split obtained from splitter.split_series, called on the data seen in transform.

transform_onstr, optional (default=”transform_train”)

What data to transform with transformer, for the i-th row of the resulting series. Values and meaning same as for fit_on.

Attributes:
is_fitted

Whether fit has been called.

See also

SummaryTransformer

Calculates summary value of a time series.

Examples

>>> from sktime.transformations.summarize import SplitterSummarizer
>>> from sktime.transformations.summarize import SummaryTransformer
>>> from sktime.split import ExpandingWindowSplitter
>>> from sktime.datasets import load_airline
>>> y = load_airline()
>>> transformer = SplitterSummarizer(
...     transformer=SummaryTransformer(),
...     splitter=ExpandingWindowSplitter())
>>> y_splitsummarized = transformer.fit_transform(y)

Methods

transform(X)

(Transforms the series according to the specified) series-to-primitives transformer and splitter.