Feature transformers
Copyright 2015-Present Randal S. Olson.
This file is part of the TPOT library.
TPOT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
TPOT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with TPOT. If not, see http://www.gnu.org/licenses/.
CategoricalSelector
¶
Bases: BaseEstimator
, TransformerMixin
Meta-transformer for selecting categorical features and transform them using OneHotEncoder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold |
int
|
Maximum number of unique values per feature to consider the feature to be categorical. |
10
|
minimum_fraction |
Minimum fraction of unique values in a feature to consider the feature to be categorical. |
None
|
Source code in tpot2/builtin_modules/feature_transformers.py
__init__(threshold=10, minimum_fraction=None)
¶
fit(X, y=None)
¶
Do nothing and return the estimator unchanged This method is just there to implement the usual API and hence work in pipelines.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
array - like
|
|
required |
Source code in tpot2/builtin_modules/feature_transformers.py
transform(X)
¶
Select categorical features and transform them using OneHotEncoder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
New data, where n_samples is the number of samples and n_components is the number of components. |
required |
Returns:
Type | Description |
---|---|
(array - like, {n_samples, n_components})
|
|
Source code in tpot2/builtin_modules/feature_transformers.py
ContinuousSelector
¶
Bases: BaseEstimator
, TransformerMixin
Meta-transformer for selecting continuous features and transform them using PCA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold |
int
|
Maximum number of unique values per feature to consider the feature to be categorical. |
10
|
svd_solver |
string {'auto', 'full', 'arpack', 'randomized'}
|
auto :
the solver is selected by a default policy based on |
'randomized'
|
iterated_power |
int >= 0, or 'auto', (default 'auto')
|
Number of iterations for the power method computed by svd_solver == 'randomized'. |
'auto'
|
Source code in tpot2/builtin_modules/feature_transformers.py
__init__(threshold=10, svd_solver='randomized', iterated_power='auto', random_state=42)
¶
Create a ContinuousSelector object.
Source code in tpot2/builtin_modules/feature_transformers.py
fit(X, y=None)
¶
Do nothing and return the estimator unchanged This method is just there to implement the usual API and hence work in pipelines.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
array - like
|
|
required |
Source code in tpot2/builtin_modules/feature_transformers.py
transform(X)
¶
Select continuous features and transform them using PCA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
New data, where n_samples is the number of samples and n_components is the number of components. |
required |
Returns:
Type | Description |
---|---|
(array - like, {n_samples, n_components})
|
|