加入新推出的
Discord 社区,展开实时讨论,获得同行支持,并直接与 Meridian 团队互动!
شی مدل را ذخیره و بارگذاری کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پس از اجرای مدل اجرا، توصیه می کنیم شی مدل را برای استفاده در آینده ذخیره کنید. این به شما کمک می کند از اجرای مدل های تکراری جلوگیری کنید و در زمان و منابع محاسباتی صرفه جویی کنید. پس از ذخیره شی مدل، شی را می توان در مرحله بعدی بارگذاری کرد تا بدون نیاز به اجرای مجدد مدل، تجزیه و تحلیل یا تجسم ها را ادامه دهد.
شی مدل را ذخیره کنید
دستور زیر را برای ذخیره شی مدل اجرا کنید:
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 داشته باشد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-24 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]