Save and load the model object
Stay organized with collections
Save and categorize content based on your preferences.
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-14 UTC."],[[["Saving the model object after a run is recommended to prevent repetitive runs and conserve resources."],["A saved model object can be loaded later for continued analysis or visualizations without needing to re-run the model."],["To save the model, use the `model.save_mmm(meridian, file_path)` command, where `file_path` includes the `PATH` and a `FILENAME` with a PKL extension."],["To load a previously saved model, use the `model.load_mmm(file_path)` command, where `file_path` includes the `PATH` and a `FILENAME` with a PKL extension."]]],[]]