新しく開設された
Discord コミュニティに参加して、リアルタイムのディスカッション、ユーザー同士のサポート、メリディアン チームとの直接の交流をお楽しみください。
モデル オブジェクトを保存して読み込む
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
モデル実行を行った後は、そのモデル オブジェクトを将来的に使えるように保存することをおすすめします。これによりモデルの重複実行を回避して、時間と計算リソースを節約できます。保存したモデル オブジェクトを後の段階で読み込めば、モデルを再実行せずに分析や可視化を続行できます。
モデル オブジェクトを保存する
モデル オブジェクトを保存するには、次のコマンドを実行します。
file_path = f'{PATH}/{FILENAME}.pkl'
model.save_mmm(meridian, file_path)
ここで
PATH
は、ファイルの場所へのパスです。
FILENAME
はファイルの名前です。拡張子は PKL にする必要があります。
モデル オブジェクトを読み込む
保存したモデルを読み込むには、次のコマンドを実行します。
file_path = f'{PATH}/{FILENAME}.pkl'
meridian=model.load_mmm(file_path)
ここで
PATH
は、ファイルの場所へのパスです。
FILENAME
はファイルの名前です。拡張子は PKL にする必要があります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-04 UTC。
[null,null,["最終更新日 2025-08-04 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,["# Save and load the model object\n\nAfter 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---------------------\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---------------------\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."]]