【问题标题】:Prophet model in scikit-hts package is not workingscikit-hts 包中的 Prophet 模型不起作用
【发布时间】:2021-07-09 18:18:21
【问题描述】:

我正在探索 python 中时间序列的分层预测,并遇到了scikit-hts 库。我使用pip install scikit-hts 安装了该软件包。我按照this 教程中提到的步骤进行操作。我创建了层次树并来到了建模部分。我想使用 Facebook 预言机算法预测底层预测。我运行了以下代码

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]

有人能解释一下为什么会这样吗?是因为包停产了还是我的安装过程有问题?

编辑:

  1. 我已经更新了我的 scikit-hts 版本,但 pip install scikit-hts[x]x=all/geo/arima/prophet)仍然没有工作

  2. 我在 jupyter notebook 中运行了我的代码。除先知外,所有模型都有效。这是代码。

    clf = hts.HTSRegressor(model='x', revision_method='OLS', n_jobs=20)
    model = clf.fit(hierarchy_train, hierarchy)
    

此代码适用于 x = auto_arimaholt_winterssarimax,但不适用于 prophet 尝试prophet时出现以下错误

AttributeError: 'NoneType' object has no attribute 'fit'

为什么模型没有为prophet 运行?

  • 我不知道它是否相关,但我已经为 arima 和其他平滑模型安装了 statsmodels 包。我已经在我的系统上安装了 fb-prophet,但我没有在我的笔记本中导入。我只做过import hts

【问题讨论】:

    标签: python machine-learning scikit-learn time-series forecasting


    【解决方案1】:

    我刚刚尝试过使用相同的参数。它没有任何错误。可能他们已经在 0.5.4 的更高版本中修复了这个问题。升级软件包后尝试检查一次。如果你到目前为止还没有这样做。

    【讨论】:

    • 我已更新到最新版本的 scikit-hts,v 0.5.6。当我尝试安装其他依赖项时,例如pip install scikit-hts[prophet]pip install scikit-hts[all] 等。它们都抛出了相同的错误no matches found: scikit-hts[all]。你能告诉我你是如何安装其他依赖项的吗?
    • 我已经使用pip install scikit-hts[all] 安装了其他依赖项,效果也很好。因此,请尝试卸载与 scikit-hts 相关的所有内容,然后使用 pip install scikit-htspip install scikit-hts[all] 重新安装或在新环境中尝试相同的命令。
    • 嗨。我添加了一些编辑。你能检查一下吗
    • 虽然你没有导入先知,import hts 就足够了。你用过pip install prophet还是pip install fbprophet
    • 使用pip install fbprophet安装了fb-prophet
    猜你喜欢
    • 2015-12-12
    • 2015-02-05
    • 2020-03-06
    • 1970-01-01
    • 2018-12-06
    • 2018-11-21
    • 2021-12-29
    • 2021-10-26
    • 2014-04-17
    相关资源
    最近更新 更多