sklearn

class SklearnModel(*args, **kwargs)[source]

Bases: pimlico.datatypes.files.NamedFile

Saves and loads scikit-learn models using the library’s joblib functions.

See the sklearn docs for more details

datatype_name = 'sklearn_model'
datatype_supports_python2 = True
get_software_dependencies()[source]

Get a list of all software required to read this datatype. This is separate to metadata config checks, so that you don’t need to satisfy the dependencies for all modules in order to be able to run one of them. You might, for example, want to run different modules on different machines. This is called when a module is about to be executed and each of the dependencies is checked.

Returns a list of instances of subclasses of :class:~pimlico.core.dependencies.base.SoftwareDependency, representing the libraries that this module depends on.

Take care when providing dependency classes that you don’t put any import statements at the top of the Python module that will make loading the dependency type itself dependent on runtime dependencies. You’ll want to run import checks by putting import statements within this method.

You should call the super method for checking superclass dependencies.

Note that there may be different software dependencies for writing a datatype using its Writer. These should be specified using get_writer_software_dependencies().

class Reader(datatype, setup, pipeline, module=None)[source]

Bases: pimlico.datatypes.files.Reader

Reader class for SklearnModel

load_model()[source]
class Setup(datatype, data_paths)

Bases: pimlico.datatypes.files.Setup

Setup class for SklearnModel.Reader

get_required_paths()

May be overridden by subclasses to provide a list of paths (absolute, or relative to the data dir) that must exist for the data to be considered ready.

reader_type

alias of SklearnModel.Reader

class Writer(*args, **kwargs)[source]

Bases: pimlico.datatypes.files.Writer

Writer class for SklearnModel

save_model(model)[source]
metadata_defaults = {}
writer_param_defaults = {}