xpandas.transformers package

Submodules

xpandas.transformers.transformer module

class xpandas.transformers.transformer.XDataFrameTransformer(transformations)[source]

Bases: sklearn.base.BaseEstimator, sklearn.base.TransformerMixin

XDataFrameTransformer is a set of XSeriesTransformer instances. XDataFrameTransformer can transform XDataFrame object to another XDataFrame based on set of XSeriesTransformer transformers.

fit(X=None, y=None, **kwargs)[source]

Fit each transformer at self.transformations dictionary

transform(X, columns_mapping=None)[source]

Transform X with fitted dictionary self.transformations. :param columns_mapping: {old_col: new_col} mapping between columns in fit data set and current X :return:

class xpandas.transformers.transformer.XSeriesTransformer(transform_function=None, data_types=None, name=None, **kwargs)[source]

Bases: sklearn.base.BaseEstimator, sklearn.base.TransformerMixin

XSeriesTransformer is a base class for all custom transformers. XSeriesTransformer is a high level abstraction to transform XSeries of specific data_types to an another XSeries or XDataFrame. XSeriesTransformer encapsulates transformation and based on scikit-learn BaseEstimator http://scikit-learn.org/stable/modules/generated/sklearn.base.BaseEstimator.html

fit(X=None, y=None, **kwargs)[source]

Fit transformer for giver data. Must be overwritten in child classes :param X: XSeries to fit transformer on :param y: Labels column for X :param kwargs: additional arguments for transformer :return: fitted self object

transform(X)[source]

Apply transformation to X with current transformer :param X: input XSeries :param columns: deprecated :return: transformed XSeries.

it could be XSeries or XDataFrame object