watex.utils.mlutils.fetch_model#

watex.utils.mlutils.fetch_model(modelfile, modelpath=None, default=True, modname=None, verbose=0)[source]#

Fetch your model saved using Python pickle module or joblib module.

Parameters:
  • modelfile – str or Path-Like object dumped model file name saved using joblib or Python pickle module.

  • modelpath – path-Like object , Path to model dumped file =`modelfile`

Default:

bool, Model parameters by default are saved into a dictionary. When default is True, returns a tuple of pair (the model and its best parameters) . If False return all values saved from ~.MultipleGridSearch

Modname:

str Is the name of model to retrived from dumped file. If name is given get only the model and its best parameters.

Verbose:

int, level=0 control the verbosity.More message if greater than 0.

Returns:

  • model_class_params: if default is True

  • pickedfname: model dumped and all parameters if default is False

Example:
>>> from watex.bases import fetch_model
>>> my_model = fetch_model ('SVC__LinearSVC__LogisticRegression.pkl',
                            default =False,  modname='SVC')
>>> my_model