watex.transformers.FrameUnion#

class watex.transformers.FrameUnion(num_attributes=None, cat_attributes=None, scale=True, imput_data=True, encode=True, param_search='auto', strategy='median', scale_mode='StandardScaler', encode_mode='OrdinalEncoder')[source]#

Unified categorial and numerical features after scaling and and categorial features encoded.

Use DataframeSelector class to define the categorial features and numerical features.

Parameters:
  • num_attributes (list) – List of numerical attributes

  • cat_attributes (list) – list of categorial attributes

  • scale (bool) – Features scaling. Default is True and use :class:~sklearn.preprocessing.StandarScaler

  • imput_data (bool ,) – Replace the missing data. Default is True and use strategy.

  • param_search (bool,) – If num_attributes and cat_attributes`are None, the numerical features and categorial features should be found automatically. Default is True

  • scale_mode (bool,) – Mode of data scaling. Default is StandardScaler``but can be a ``MinMaxScaler

  • encode_mode (bool,) – Mode of data encoding. Default is OrdinalEncoder but can be OneHotEncoder but creating a sparse matrix. Once selected, the new shape of X should be different from the original shape.

Example

>>> from watex.datasets import fetch_data
>>> from watex.utils.transformers import FrameUnion
>>> X_= fetch_data ('Bagoue original').get('data=dfy1')
>>> frameObj = FrameUnion(X_, encoding =OneHotEncoder)
>>> X= frameObj.fit_transform(X_)