Join the newly launched
Discord community for real-time discussions, peer support, and direct interaction with the Meridian team!
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 2025-06-11 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 2025-06-11 UTC."],[[["\u003cp\u003eSaving the model object after a run is recommended to prevent repetitive runs and conserve resources.\u003c/p\u003e\n"],["\u003cp\u003eA saved model object can be loaded later for continued analysis or visualizations without needing to re-run the model.\u003c/p\u003e\n"],["\u003cp\u003eTo save the model, use the \u003ccode\u003emodel.save_mmm(meridian, file_path)\u003c/code\u003e command, where \u003ccode\u003efile_path\u003c/code\u003e includes the \u003ccode\u003ePATH\u003c/code\u003e and a \u003ccode\u003eFILENAME\u003c/code\u003e with a PKL extension.\u003c/p\u003e\n"],["\u003cp\u003eTo load a previously saved model, use the \u003ccode\u003emodel.load_mmm(file_path)\u003c/code\u003e command, where \u003ccode\u003efile_path\u003c/code\u003e includes the \u003ccode\u003ePATH\u003c/code\u003e and a \u003ccode\u003eFILENAME\u003c/code\u003e with a PKL extension.\u003c/p\u003e\n"]]],[],null,["After executing the model run, we recommend saving the model object for future\nuse. This helps you avoid repetitive model runs, and saves time and\ncomputational resources. After the model object is saved, the object can be\nloaded at a later stage to continue the analysis or visualizations without\nhaving to re-run the model.\n\nSave the model object\n\nRun the following command to save the model object: \n\n file_path = f'{PATH}/{FILENAME}.pkl'\n model.save_mmm(meridian, file_path)\n\nWhere:\n\n- `PATH` is the path to the file location.\n- `FILENAME` is the name of the file. It must have a PKL extension.\n\nLoad the model object\n\nRun the following command to load the saved model: \n\n file_path = f'{PATH}/{FILENAME}.pkl'\n meridian=model.load_mmm(file_path)\n\nWhere:\n\n- `PATH` is the path to the file location.\n- `FILENAME` is the name of the file. It must have a PKL extension."]]