问题描述
今天晚上早些时候,我为我目前正在进行的一个项目打开了一个 jupyter notebook,并更新了我正在使用的数据集,重新运行了 notebook,瞧,在执行以下操作之后,我遇到了以下问题代码:
df_fbprophet = df
df_m = df_fbprophet.resample("D").size().reset_index()
df_m.columns = ["date","daily_crime_count"]
df_m_final = df_m.rename(columns={"date": "ds","daily_crime_count": "y"})
m = Prophet(interval_width=0.95,yearly_seasonality=False)
m.add_seasonality(name="monthly",period=30.5,fourier_order=10)
m.add_seasonality(name="quarterly",period=91.5,fourier_order=10)
m.add_seasonality(name="weekly",period=52,fourier_order=10)
m.add_seasonality(name="daily",period=365,fourier_order=10)
m.fit(df_m_final)
future = m.make_future_dataframe(periods=365,freq="D")
forecast = m.predict(future)
fig = m.plot(forecast)
a = add_changepoints_to_plot(fig.gca(),m,forecast)
fig2 = m.plot_components(forecast)
fig2_1 = plot_plotly(m,forecast)
fig2_1```
which produces the following output:
INFO:fbprophet:Found custom seasonality named 'weekly',disabling built-in 'weekly' seasonality.
INFO:fbprophet:Found custom seasonality named 'daily',disabling built-in 'daily' seasonality.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
KeyError: 'metric_file'
So far I've been unable to solve it on my own. Any ideas guys?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)