BPt.Sampler#

class BPt.Sampler(obj, ref_scope=None, params=0, cache_loc=None, **extra_params)[source]#

The Sampler is a Pipeline or ModelPipeline piece that is used for operations which involve changing the number of subjects in just the training set.

Note: This object is still experimental, and not yet fully tested.

Parameters
objstr or custom obj
obj if passed a str, must be a predefined sampler. Can also pass a sklearn compatible custom object here directly.
See Pipeline Objects to read more about pipeline objects in general.
ref_scopeScope, optional
The parameter is passed as any valid scope, or None if not needed, and if non-null is used to pass along information on which columns - typically non input ones, should be passed along the base sampler object. E.g., in the case of over-sampling, passing a scope here would indicate which columns values the oversampling should be based on.
default = None
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
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.