我在Python中使用fbprophet进行时间序列预测,我想知道yhat
(prediction)列是如何计算的。我用了下面的代码。在
import quandl
import fbprophet
tesla = quandl.get('WIKI/TSLA')
tesla = tesla.reset_index()
tesla = tesla.rename(columns={'Date': 'ds', 'Adj. Close': 'y'})
tesla = tesla[['ds', 'y']]
prophet = fbprophet.Prophet()
prophet.fit(tesla)
future = prophet.make_future_dataframe(periods=365)
future = prophet.predict(future)
future
数据帧包含以下列:
我知道yhat
是预测,但它是{
我尝试过组合trend, seasonal, seasonalities, weekly, yearly
列,看看它们是否等于yhat
列,但它们不:
future['combination'] = future['trend'] + future['seasonal'] + future['weekly'] + future['yearly'] + future['seasonalities']
print(future[['combination', 'yhat']].head())
combination yhat
0 57.071956 27.681139
1 55.840545 27.337270
2 53.741200 26.704090
3 51.874192 26.148355
4 47.827763 25.065950
我在文件中找不到答案,但如果我只是错过了,请道歉。在
现在情况似乎已经改变了。看看Github代码,yhat计算如下
yhat=(趋势*(1+乘法项)+加法项
我是
fbprophet
的初学者,但我想分享我的猜测。 即使我不确定它是否正确,下面的等式可能在prophet的默认设置下成立。在希望我的回答能帮助你!在
相关问题 更多 >
编程相关推荐