我正在用python探索时间序列的分层预测,并偶然发现了scikit-hts库。我使用pip install scikit-hts
安装了这个包。我遵循了this教程中提到的步骤。我创建了层次树,并来到了建模部分。我想用Facebook prophet算法预测底层预测。我运行了以下代码
clf = hts.HTSRegressor(model='prophet', revision_method='AHP', n_jobs=0)
model = clf.fit(hierarchy_train, hierarchy)
这引发了警告信息
Fitting models: 0%| | 0/46 [00:00<?, ?it/s]prophet model requires fbprophet to
work. Exiting.Install it with: pip install scikit-hts[prophet]
Fitting models: 0%| | 0/46 [00:00<?, ?it/s]
这个错误信息
AttributeError: 'NoneType' object has no attribute 'fit'
我试图从here安装每个附加包。但它会为每个包抛出以下错误消息(此处仅针对arima模型显示)
zsh: no matches found: scikit-hts[arima]
有人能解释一下为什么会这样吗?是因为软件包已停止使用,还是我的安装过程中存在问题
编辑:
我已经更新了我的scikit hts版本,但仍然pip install scikit-hts[x]
(其中x=all/geo/arima/prophet
)不起作用
我在jupyter笔记本上运行了我的代码。除了prophet,所有的模型都能工作。这是代码
clf = hts.HTSRegressor(model='x', revision_method='OLS', n_jobs=20)
model = clf.fit(hierarchy_train, hierarchy)
此代码运行于x=auto_arima
,holt_winters
,sarimax
,但不运行于prophet
我在尝试prophet
时遇到以下错误
AttributeError: 'NoneType' object has no attribute 'fit'
为什么模型没有为prophet
运行
import hts
我刚刚试过使用相同的参数。它没有任何错误。可能他们已经在0.5.4的更高版本中修复了此问题。升级包后,请尝试检查一次。如果你到目前为止还没有这样做
相关问题 更多 >
编程相关推荐