今天,我的colab脚本开始出现问题,它使用的是facebook prophet。我尝试在一个基本的脚本上重现这个错误。
问题出在line:
m.fit(df)在这里你可以找到错误:
KeyError Traceback (most recent call last)<br>
KeyError: 'metric_file'<br>
and the session crashed.<br>
<br>你可以在这里找到完整的代码:
Python
import pandas as pd
from fbprophet import Prophet
df=pd.read_csv('https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_log_peyton_manning.csv')
df.head()
m = Prophet()
m.fit(df)
forecast = m.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail()
fig1 = m.plot(forecast)谢谢,F。
发布于 2021-12-08 16:14:49
100%保证的解决方案!
安装pandas:pip install pandas==1.0.4
安装pystan:conda install -c conda-forge pystan==2.19.1.1
安装fbprophet:conda install -c conda-forge fbprophet conda install -c conda-forge/label/cf201901 fbprophet
按照下面的步骤运行你的代码,它会解决这个问题。
发布于 2021-12-19 18:21:09
尝试下面的代码来解决这个问题。
conda install pystan==2.17.1.0
conda install -c conda-forge fbprophet==0.6.0发布于 2019-10-31 15:29:49
现在是固定购买谷歌。
我的脚本中有一个错误,我忘了插入两行。你可以在这里找到可用的代码:
“先知简介来自:https://facebook.github.io/prophet/docs/quick_start.html#python-api”
Python
将熊猫作为pd从fbprophet导入Prophet
Python
df=pd.read_csv('https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_log_peyton_manning.csv')
df.head()
M=先知(Prophet)
m.fit(df)
**未来=未来(periods=365)
future.tail()**
预测=m.predict(未来)
forecast['ds','yhat','yhat_lower','yhat_upper'].tail()
fig1 =m.plot(预测)
https://stackoverflow.com/questions/58624621
复制相似问题