PandasFeatureUnion

class paralytics.PandasFeatureUnion(transformer_list, n_jobs=None, transformer_weights=None, verbose=False)[source]

Bases: sklearn.pipeline.FeatureUnion

Concatenates results of multiple pandas.DataFrame transformers.

Using FeatureUnion capabilities from scikit-learn applies multiple transformers always returning pandas.DataFrame object.

References

[1] marrrcin, pandas-feature-union, 2018

Methods Summary

fit_transform(self, X[, y])

Fits and transforms data based on transformers inside pipeline.

merge_dataframes_by_column(self, X)

Concatenates dataframes which resulted from different operations.

transform(self, X)

Applies conversions which are found in transformer_list.

Methods Documentation

fit_transform(self, X, y=None, **fit_params)[source]

Fits and transforms data based on transformers inside pipeline.

Parameters
X: DataFrame, shape = (n_samples, n_features)

Data with n_samples as its number of samples and n_features as its number of features.

Returns
X_new: DataFrame, shape = (k_samples, k_features)

X data with substituted binary-like category columns with its corresponding binary values.

Notes

The transformer has to return pandas.DataFrame object.

merge_dataframes_by_column(self, X)[source]

Concatenates dataframes which resulted from different operations.

Parameters
X: DataFrame, shape = (n_samples, n_features)

Data with n_samples as its number of samples and n_features as its number of features.

Returns
X_new: DataFrame, shape = (n_samples, n_features)

X data with substituted binary-like category columns with its corresponding binary values.

transform(self, X)[source]

Applies conversions which are found in transformer_list.

Parameters
X: DataFrame, shape = (n_samples, n_features)

Data with n_samples as its number of samples and n_features as its number of features.

Returns
X_new: DataFrame, shape = (n_samples, n_features)

X data with substituted binary-like category columns with its corresponding binary values.

Notes

Returns pandas.DataFrame object.