BPt.Scaler#

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

The Scaler piece refers to a piece in the Pipeline or ModelPipeline, which is responsible for performing any sort of scaling or transformation on the data which doesn’t require the target variable, and doesn’t change the number of data points or features. These are typically transformations like feature scaling.

Parameters
objstr or custom obj
obj if passed a str selects a scaler from the preset defined scalers, See Scalers for all available options. If passing a custom object, it must be a sklearn compatible transformer, and further must not require the target variable, not change the number of data points or features.

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.
default = 'float'
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.