TimeSeriesPredictor.load

classmethod TimeSeriesPredictor.load(path: str | Path, require_version_match: bool = True) TimeSeriesPredictor[source]

Load an existing TimeSeriesPredictor from given path.

警告

autogluon.timeseries.TimeSeriesPredictor.load() 隐式使用了 pickle 模块,众所周知这是不安全的。有可能构造恶意的 pickle 数据,在反序列化期间执行任意代码。切勿加载可能来自不可信来源的数据,或可能被篡改的数据。只加载你信任的数据。

Parameters:
  • 路径 (strpathlib.Path) – 通过 save() 保存预测器的路径。

  • require_version_match (bool, default = True) – 如果为True,当加载的预测器的autogluon.timeseries版本与已安装的autogluon.timeseries版本不匹配时,将引发一个AssertionError。 如果为False,将允许加载在不兼容版本上训练的模型,但不推荐这样做。用户如果尝试这样做,可能会遇到许多问题。

Returns:

预测器

Return type:

TimeSeriesPredictor

示例

>>> predictor = TimeSeriesPredictor.load(path_to_predictor)