TimeSeriesPredictor.load¶
- classmethod TimeSeriesPredictor.load(path: str | Path, require_version_match: bool = True) TimeSeriesPredictor [source]¶
从给定
path
加载现有的TimeSeriesPredictor
。警告
autogluon.timeseries.TimeSeriesPredictor.load()
隐式使用了 pickle 模块,该模块已知不安全。可以构造恶意 pickle 数据,在反序列化时执行任意代码。切勿加载可能来自不受信任来源或可能被篡改的数据。仅加载您信任的数据。- 参数:
path (str 或 pathlib.Path) – 预测器通过
save()
保存的路径。require_version_match (bool, 默认值 = True) – 如果为 True,则如果加载的预测器的
autogluon.timeseries
版本与已安装的autogluon.timeseries
版本不匹配,将引发 AssertionError。如果为 False,将允许加载在不兼容版本上训练的模型,但强烈不建议这样做。用户尝试此操作时可能会遇到许多问题。
- 返回:
预测器
- 返回类型:
示例
>>> predictor = TimeSeriesPredictor.load(path_to_predictor)