prophet是Facebook开源库,在Python和R中提供的预测工具,详细介绍见fbprophet, 想看中文版的在这prophet模型小结
github地址:https://github.com/facebook/prophet
1. 安装prophet之前首先安装pyStan
pip install pyStan
2.安装fbprophet
pip install fbprophet
出现如下报错:ERROR:fbprophet:Importing plotly failed. Interactive plots will not work.
参照 这篇博客https://www.jianshu.com/p/afe4e7c0a7eb安装 plotly模块
不知道为什么我电脑不能用conda安装。。。。还是用pip安装
pip install plotly
成功。。
3. 使用 fbprophet
报错提醒:fit()的输入数据必须包括"ds"和“y",ds是dates, y是值
df = df.rename(columns={"Month":"ds","#Passengers":"y"})
后面大概就没啥 问题,可以参考官方文档quit start