sktime.series_as_features.compose¶
-
class
sktime.series_as_features.compose.
FeatureUnion
(transformer_list, n_jobs=None, transformer_weights=None, preserve_dataframe=True)[source]¶ Bases:
sklearn.pipeline.FeatureUnion
,sktime.transformations.base._PanelToPanelTransformer
Concatenates results of multiple transformer objects. This estimator applies a list of transformer objects in parallel to the input data, then concatenates the results. This is useful to combine several feature extraction mechanisms into a single transformer. Parameters of the transformations may be set using its name and the parameter name separated by a ‘__’. A transformer may be replaced entirely by setting the parameter with its name to another transformer, or removed by setting to ‘drop’ or
None
. :param transformer_list: List of transformer objects to be applied to the data. The firsthalf of each tuple is the name of the transformer.
- Parameters
n_jobs (int or None, optional (default=None)) – Number of jobs to run in parallel.
None
means 1 unless in ajoblib.parallel_backend
context.-1
means using all processors.transformer_weights (dict, optional) – Multiplicative weights for features per transformer. Keys are transformer names, values the weights.
-
fit
(X, y=None, **fit_params)[source]¶ Fit all transformers using X.
- Parameters
X (iterable or array-like, depending on transformers) – Input data, used to fit transformers.
y (array-like of shape (n_samples, n_outputs), default=None) – Targets for supervised learning.
- Returns
self – This estimator
- Return type
-
fit_transform
(X, y=None, **fit_params)[source]¶ Fit all transformations, transform the data and concatenate results. :param X: Input data to be transformed. :type X: pandas DataFrame :param y: Targets for supervised learning. :type y: pandas Series, shape (n_samples, …), optional
- Returns
Xt – hstack of results of transformations. sum_n_components is the sum of n_components (output dimension) over transformations.
- Return type
pandas DataFrame
-
transform
(X)[source]¶ Transform X separately by each transformer, concatenate results. :param X: Input data to be transformed. :type X: pandas DataFrame
- Returns
Xt – hstack of results of transformations. sum_n_components is the sum of n_components (output dimension) over transformations.
- Return type
pandas DataFrame