【发布时间】:2020-05-08 14:19:31
【问题描述】:
我正在尝试使用 Facebook Prophet 进行预测,输入都是正数,但预测返回负数。我有点困惑,我读了这个quick start,如果输入都是正数,那么预测可能都是正数,并且预测的形状与输入相似,例如,如果输入为 0.86,那么输出将为 0.81 .为什么会这样?如何解决?
covid_pr = covid[['date','acc_confirmed']].copy()
covid_pr.rename(columns = {'date':'ds', 'acc_confirmed':'y'},inplace= True)
prt = Prophet()
prt.fit(covid_pr)
future_prt = prt.make_future_dataframe(30)
forecast = prt.predict(future_prt)
我的输入数据
ds y
0 2020-03-02 2
1 2020-03-03 2
2 2020-03-04 2
3 2020-03-05 2
4 2020-03-06 4
5 2020-03-07 4
6 2020-03-08 6
7 2020-03-09 19
8 2020-03-10 27
9 2020-03-11 34
10 2020-03-12 34
etc until thousands
fbprophet 的预测
yhat yhat_lower yhat_upper
0 -261.572541 -499.409024 -4.741004
1 -208.490561 -446.503629 41.371788
2 -255.114682 -500.580393 -7.825269
3 -208.963597 -481.238870 33.707433
4 -146.566250 -394.337188 96.726382
5 -92.445918 -354.914790 150.409867
6 -38.341696 -293.639411 204.964963
7 83.483534 -158.412231 332.263619
8 136.565514 -95.174934 370.980615
9 89.941393 -153.219255 349.129866
10 136.097121 -95.508485 404.666524
etc until thousands
【问题讨论】:
-
你能画出数据和预测吗?如果存在负面趋势,则预测很可能会遵循该趋势(对于任何好的模型),无论考虑到建模域这是否有意义。我在这里看不到任何代码问题,本身,所以最好在Cross Validated 询问。
-
从 fbprohphet 组件来看,它表明存在负的每周季节性
标签: python time-series forecast facebook-prophet