energy_fault_detector.core.save_load_mixin

class SaveLoadMixin(**kwargs)

Bases: object

Save and load methods for model-like (regressors/classifiers/transformers) objects.

Override the save and load functions when one of the attributes cannot be pickled, such as keras/tensorflow models.

load(directory, file_name=None)

Load the model object from given directory. Note: override when using Keras/Tensorflow, as those models cannot be pickled.

save(directory, overwrite=False, file_name=None)

Save the model object in given directory, filename is the class name. Note: override when using Keras/Tensorflow, as those models cannot be pickled.

Parameters:
  • directory (str) – directory to save the object in.

  • overwrite (bool) – whether to overwrite existing data, default False.

  • file_name (str) – name of the file to save the object in, if none, take the class name.