【发布时间】:2022-12-03 20:10:36
【问题描述】:
在对一些时间序列数据拟合 AutoTS 模型后,如何保存和加载经过训练的最佳模型?尽管 AutoTS 对象具有 export_template() 和 import_template() 函数来保存最佳模型,但是从该模板加载最佳模型时,它需要重新拟合。如何在生产中使用这样的解决方案?我的代码:
from autots import AutoTS
model = AutoTS(
frequency='infer',
prediction_interval=0.9,
ensemble=None,
model_list="fast", # "superfast", "default", "fast_parallel"
transformer_list="fast", # "superfast",
drop_most_recent=1,
max_generations=4,
num_validations=2,
validation_method="backwards")
model.fit(df_day,date_col='xyz',value_col='abc')
model.export_template("unique_user_1", models='best', n=1, max_per_model_class=3)
现在,在一些新的例子中,当我这样做
model = model.import_template('unique_user_1.csv',method='only')
该模型需要重新训练。
【问题讨论】:
标签: python machine-learning time-series data-science forecasting