【问题标题】:'StanModel' object has no attribute 'fit_class' while using Prophet“StanModel”对象在使用 Prophet 时没有属性“fit_class”
【发布时间】:2021-08-21 12:58:32
【问题描述】:

我正在尝试使用先知。 我已经安装了所有必需的软件包:

pip install pandas numpy jupyterlab seaborn 
conda install pywin32 
conda install -c anaconda pystan=2.19.1.1=py38hac22706_0
conda install -c conda-forge prophet 
conda install -c conda-forge tensorflow 
pip install darts 
conda install -c conda-forge prophet

为什么是pystan=2.19.1.1=py38hac22706_0?因为有人有这个版本,一切都很好,所以他建议这个版本。相同的 Windows 系统,相同的安装包顺序。但是我在拟合模型时遇到了错误'StanModel' object has no attribute 'fit_class'

model = Prophet()
model.fit(train)
prediction = model.predict(len(val))

我检查了我是否真的有Pystan,我真的有它。

请帮忙。

【问题讨论】:

    标签: python pystan prophet


    【解决方案1】:

    卸载 fbprophet 和 pystan,然后:

    pip install pystan==2.19.1.1
    pip install prophet
    

    from prophet import Prophet
    

    【讨论】:

      【解决方案2】:

      这发生在我在运行 jupyter notebook 时安装了先知后。我只是重新启动了内核,然后它就可以工作了。

      【讨论】:

        【解决方案3】:

        据我所知,pystan==1.0.1pystan==2.19.1.1

        错误

        “StanModel”对象没有属性“fit_class”

        可能由低于3.0.0pystan 版本引起。由于httpstan 包,在Windows 机器上安装它可能会出现问题。

        根据documentationhttpstan 1.0.0 以上的版本不支持Windows:

        要求

        Python version 3.7 or higher.
        macOS or Linux.
        C++ compiler: gcc ≥9.0 or clang ≥10.0.
        

        我目前找到的唯一解决方案是使用DockerVM。 Windows 也有WSL

        【讨论】:

          猜你喜欢
          • 2021-03-18
          • 2020-04-05
          • 1970-01-01
          • 2020-07-02
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-04-12
          • 2018-07-19
          相关资源
          最近更新 更多