watex.transformers.DataFrameSelector#
- class watex.transformers.DataFrameSelector(attribute_names=None, select_type=None)[source]#
Select data from specific attributes for column transformer.
Select only numerical or categorial columns for operations. Work as the same like sckit-learn make_colum_tranformer
- Parameters
*attribute_names* (list or array_like) β List of the main columns to keep the data
*select_type* (str) β Automatic numerical and categorial selector. If select_type is
num, only numerical values in dataframe are retrieved elsecatfor categorials attributes.
- Returns
X β New array with composed of data of selected attribute_names.
- Return type
ndarray
Examples
>>> from watex.transformers import DataFrameSelector >>> from watex.utils.mlutils import load_data >>> df = mlfunc.load_data('data/geo_fdata') >>> XObj = DataFrameSelector(attribute_names=['power','magnitude','sfi'], ... select_type=None) >>> cdf = XObj.fit_transform(df)