BPt.Transformer#

class BPt.Transformer(obj, params=0, scope='input data', cache_loc=None, **extra_params)[source]#

The Transformer is base optional component of the Pipeline or ModelPipeline classes. Transformers define any type of transformation to the loaded data which may change the number of features in a non-simple way (i.e., conceptually distinct from FeatSelector, where you know in advance the transformation is just selecting a subset of existing features). These are transformations like applying Principle Component Analysis, or on the fly One Hot Encoding.

Parameters
objstr or custom_obj

obj if passed a str selects from the available class defined options for transformer as found at Transformers.

If a custom object is passed as obj, it must be a sklearn api compatible transformer (i.e., have fit, transform, get_params and set_params methods, and further be cloneable via sklearn’s clone function).

See Pipeline Objects to read more about pipeline objects in general.

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.
It may in some cases be useful to consider the use of Duplicate here.
default = 'input data'
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
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.

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.