无法从 statsmodels 导入 MSTL

dog*_*ogo 6 statistics machine-learning time-series statsmodels deep-learning

我目前正在尝试从 statsmodels.tsa.seasonal 的 MSTL 模块(https://www.statsmodels.org/devel/ generated/statsmodels.tsa.seasonal.MSTL.html )导入 MSTL,但它返回一个 ImportError 。我已经在 MAC M1 2020 上安装了 conda 的 statsmodels

小智 10

我刚刚遇到了同样的问题并做了一些研究。看来 MSTL 仅在最新版本的 statsmodels 上可用:版本 0.14.0

如果您使用安装 statsmodels conda install -c conda-forge statsmodels,您将获得 statsmodels 0.13.2 版本。

(使用脚本编辑器,尝试通过 C:\Users{用户名}\Anaconda3\Lib\site-packages\statsmodels 搜索“MSTL”,或者在计算机上安装 statsmodels 的任何位置,您可能找不到它)

您需要从 statsmodels 的 github 存储库上的最新源安装最新版本: www.statsmodels.org/dev/install.html

从 anaconda 提示符处:

git clone https://github.com/statsmodels/statsmodels.git
pip install git+https://github.com/statsmodels/statsmodels

您将需要安装 C 编译器和 git 对于 git,您可以使用:conda install -c anaconda git

请小心,因为最新版本的安装可能会干扰其他已安装的 python 软件包。我建议您为此使用 conda 虚拟环境。