TSColumnTransformer

class hcrystalball.compose.TSColumnTransformer(transformers, *, remainder='drop', sparse_threshold=0.3, n_jobs=None, transformer_weights=None, verbose=False)[source]

Bases: sklearn.compose._column_transformer.ColumnTransformer

Time Series compatible ColumnTransformer.

Allow usage of hcrystalball wrappers and index based transformers. See also: sklearn.compose.ColumnTransformer

Returns

Data transformed on given column

Return type

pandas.DataFrame

Raises

ValueError – If remainder=='passthrough' is set. Use passthrough as an identity estimator If sparse output is requested, but not all columns are numeric

Attributes Summary

named_transformers_

Access the fitted transformer by name.

remainder

Access to original remainder

Methods Summary

fit(X[, y])

Fit all transformers using X.

fit_transform(X[, y])

Run index aware fit_transform

get_feature_names()

Get feature names from all transformers.

get_params([deep])

Get parameters for this estimator.

set_params(**kwargs)

Set the parameters of this estimator.

transform(X)

Run index aware transform

Attributes Documentation

named_transformers_

Access the fitted transformer by name.

Read-only attribute to access any transformer by given name. Keys are transformer names and values are the fitted transformer objects.

remainder

Access to original remainder

Methods Documentation

fit(X, y=None)

Fit all transformers using X.

Parameters
  • X ({array-like, dataframe} of shape (n_samples, n_features)) – Input data, of which specified subsets are used to fit the transformers.

  • y (array-like of shape (n_samples,..), default=None) – Targets for supervised learning.

Returns

self – This estimator

Return type

ColumnTransformer

fit_transform(X, y=None)[source]

Run index aware fit_transform

Parameters
Returns

Transformed data by given transformer on given column

Return type

pandas.DataFrame

get_feature_names()[source]

Get feature names from all transformers.

Returns

feature_names – Names of the features produced by transform.

Return type

list of strings

get_params(deep=True)

Get parameters for this estimator.

Parameters

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns

params – Parameter names mapped to their values.

Return type

dict

set_params(**kwargs)

Set the parameters of this estimator.

Valid parameter keys can be listed with get_params().

Returns

Return type

self

transform(X)[source]

Run index aware transform

Parameters

X (pandas.DataFrame) – Input features.

Returns

Transformed data by given transformer on given column

Return type

pandas.DataFrame