mlshell.Pipeline

class mlshell.Pipeline(pipeline=None, oid=None, dataset_id=None)[source]

Bases: object

Unified pipeline interface.

Implements interface to access arbitrary pipeline. Interface: is_classifier, is_regressor, dump, set_params and all underlying pipeline object methods.

pipeline

Underlying pipeline.

Type

sklearn estimator

dataset_id

If pipeline is fitted, train dataset identifier, otherwise None.

Type

str

Notes

Calling unspecified methods are redirected to underlying pipeline object.

Methods

dump(filepath, **kwargs)

Dump the pipeline on disk.

fit(*args, **kwargs)

Fit pipeline.

is_classifier()

Check if pipeline classifier.

is_regressor()

Check if pipeline regressor.

set_params(*args, **kwargs)

Set pipeline params.

__init__(pipeline=None, oid=None, dataset_id=None)[source]
Parameters
  • pipeline (sklearn estimator, optional (default=None)) – Pipeline to wrap.

  • oid (str) – Instance identifier.

  • dataset_id (str, optional (default=None),) – Train dataset identifier if pipeline is fitted, otherwise None.

Methods

__init__([pipeline, oid, dataset_id])

param pipeline

Pipeline to wrap.

dump(filepath, **kwargs)

Dump the pipeline on disk.

fit(*args, **kwargs)

Fit pipeline.

is_classifier()

Check if pipeline classifier.

is_regressor()

Check if pipeline regressor.

set_params(*args, **kwargs)

Set pipeline params.

fit(*args, **kwargs)[source]

Fit pipeline.

set_params(*args, **kwargs)[source]

Set pipeline params.

is_classifier()[source]

Check if pipeline classifier.

is_regressor()[source]

Check if pipeline regressor.

dump(filepath, **kwargs)[source]

Dump the pipeline on disk.

Parameters
  • filepath (str) – File path without extension.

  • **kwargs (dict) –

  • Additional kwargs to pass in dump(**kwargs) (`) –

Returns

fullpath – Full file path.

Return type

str