Save and load the model object

After executing the model run, we recommend saving the model object for future use. This helps you avoid repetitive model runs, and saves time and computational resources. After the model object is saved, the object can be loaded at a later stage to continue the analysis or visualizations without having to re-run the model.

Save the model object

Run the following command to save the model object:

file_path = f'{PATH}/{FILENAME}.pkl'
model.save_mmm(meridian, file_path)

Where:

  • PATH is the path to the file location.
  • FILENAME is the name of the file. It must have a PKL extension.

Load the model object

Run the following command to load the saved model:

file_path = f'{PATH}/{FILENAME}.pkl'
meridian=model.load_mmm(file_path)

Where:

  • PATH is the path to the file location.
  • FILENAME is the name of the file. It must have a PKL extension.