SerializableModelMixin#

class SerializableModelMixin[स्रोत]#

आधार: object

Provides convenient methods for saving and loading models.

Methods

classmethod load(file_name)[स्रोत]#

Loads a model from the file. If the loaded model is not an instance of the class whose method was called, then a warning is raised. Nevertheless, the loaded model may be a valid model.

मापदण्ड:

file_name (str) -- a file name or path to load a model from.

प्रदत्त :

A loaded model.

उभारता है :

TypeError -- if a loaded model is not an instance of the expected class.

प्रदत्त प्रकार :

Any

save(file_name)[स्रोत]#

Saves this model to the specified file. Internally, the model is serialized via dill. All parameters are saved, including a primitive instance that is referenced by internal objects. That means if a model is loaded from a file and is used, for instance, for inference, the same primitive will be used even if a cloud primitive was used.

मापदण्ड:

file_name (str) -- a file name or path where to save the model.