BPt.ModelPipeline.build#
- ModelPipeline.build(dataset='default', problem_spec='default', **problem_spec_params)[source]#
This method generates a sklearn compliant estimator version of the current
Pipeline
with respect to a passed dataset andDataset
andProblemSpec
.This method calls
get_estimator()
with pipeline set as itself.- Parameters
- dataset
Dataset
or ‘default’, optional The Dataset in which the pipeline should be initialized according to. For example, pipeline’s can include scopes, which require a reference dataset.
If left as default will initialize and use an instance of a FakeDataset class, which will work fine for initializing pipeline objects with scope of ‘all’, but should be used with caution when elements of the pipeline use non ‘all’ scopes. In these cases a warning will be issued.
It is advisable to use this build function only for viewing pipelines. If using the build function instead for eventual modelling it is important to pass the correct
Dataset
in the case that any of the pipeline pieces are at all dependant on the structure of the input data.Note: If problem type is not defined in problem_spec and Dataset is left as default, then a problem type of ‘regression’ will be used.
default = 'default'
- problem_spec
ProblemSpec
or ‘default’, optional This parameter accepts an instance of the params class
ProblemSpec
. The ProblemSpec is essentially a wrapper around commonly used parameters needs to define the context the model pipeline should be evaluated in. It includes parameters like problem_type, scorer, n_jobs, random_state, etc…See
ProblemSpec
for more information and for how to create an instance of this object.If left as ‘default’, then will initialize a ProblemSpec with default params.
default = "default"
- problem_spec_params
ProblemSpec
params, optional You may also pass any valid problem spec argument-value pairs here, in order to override a value in the passed
ProblemSpec
. Overriding params should be passed in kwargs style, for example:func(..., problem_type='binary')
- dataset
- Returns
- estimatorsklearn compatible estimator
Returns the BPt-style sklearn compatible estimator version of this piece as converted to internally when building the pipeline
- paramsdict
Returns a dictionary with any parameter distributions associated with this object, for example this can be used to check what exactly pre-existing parameter distributions point to.