BPt.FeatSelector#

class BPt.FeatSelector(obj, params=0, scope='all', cache_loc=None, base_model=None, **extra_params)[source]#

The FeatSelector class is a base piece of ModelPipeline or Pipeline, which is designed to preform feature selection.

Parameters
objstr or custom_obj
The obj parameter selects which feature selection strategy to use.
See Feat Selectors for all available preset options and Pipeline Objects to read more about pipeline objects in general.
Notably, if ‘rfe’ (recursive feature elimination) is passed, then a base model must also be passed!
paramsint, str or dict of params, optional
The parameter params can be used to set an associated distribution of hyper-parameters, fixed parameters or combination of.
Preset parameter options can be found distributions are listed for each choice of params with the corresponding obj at Pipeline Options.
More information on how this parameter works can be found at Params.
default = 0
scopeScope, optional
The scope parameter determines the subset of features / columns in which this object should operate on within the created pipeline. For example, by specifying scope = ‘float’, then this object will only operate on columns with scope float.
See Scope for more information on how scopes can be specified.
default = 'all'
cache_locstr, Path or None, optional
This parameter can optionally be set to a str or path representing the location in which this object will be cached after fitting. To skip this option, keep as the default argument of None.
If set, the python library joblib is used to cache a copy after fitting and in the case that a cached copy already exists will load from that copy instead of re-fitting the base object.
default = None
base_modelModel, Ensemble or None, optional
If ‘rfe’ is passed to obj, then a base_model is required in order to perform recursive feature elimination.
The base model can be any valid Model or Ensemble.
default = None
extra_paramsExtra Params
You may pass additional kwargs style arguments for this piece as Extra Params. Any values passed here will be used to try and set that value in the requested obj.
Any parameter value pairs specified here will take priority over any set via params. For example, lets say in the object we are initializing, ‘fake obj’ it has a parameter called size, and we want it fixed as 10, we can specify that with:
(obj='fake obj', ..., size=10)

See Extra Params for more information.

See also

Scaler

For pieces which don’t change the number of features.

Transformer

For pieces which change the number of features in different ways.

Methods

build([dataset, problem_spec])

This method is used to convert a single pipeline piece into the base sklearn style object used in the pipeline.

copy()

This method returns a deepcopy of the base object.

get_params([deep])

Get parameters for this estimator.

set_params(**params)

Set the parameters of this estimator.