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
DataframeSelectorclass 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
Trueand use :class:~sklearn.preprocessing.StandarScalerimput_data (bool ,) – Replace the missing data. Default is
Trueand usestrategy.param_search (bool,) – If num_attributes and cat_attributes`are None, the numerical features and categorial features should be found automatically. Default is
Truescale_mode (bool,) – Mode of data scaling. Default is
StandardScaler``but can be a ``MinMaxScalerencode_mode (bool,) – Mode of data encoding. Default is
OrdinalEncoderbut can beOneHotEncoderbut creating a sparse matrix. Once selected, the new shape ofXshould 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_)