作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在Python中使用fbprophet进行时间序列预测,我想知道yhat
(预测)列是如何计算的。我使用了以下代码。
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
数据框包含以下列:
['ds', 'trend', 'trend_lower', 'trend_upper', 'yhat_lower', 'yhat_upper',
'seasonal', 'seasonal_lower', 'seasonal_upper', 'seasonalities',
'seasonalities_lower', 'seasonalities_upper', 'weekly', 'weekly_lower',
'weekly_upper', 'yearly', 'yearly_lower', 'yearly_upper', 'yhat']
我知道yhat
是预测,但它是趋势、季节性、季节性、每周、每年
还是其他内容的组合?
我尝试将 trend、seasonal、seasonality、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
我无法在文档中找到答案,但如果我只是错过了它,我深表歉意。
最佳答案
我是 fbprophet
的初学者,但想分享我的猜测。尽管我不确定它是否正确,但以下等式可能在预言家的默认设置下成立。
yhat = trend + seasonal
希望我的回答对您有帮助!
关于python - fbprophet库中的 'yhat'(预测)是如何计算的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48218323/
我正在Python中使用fbprophet进行时间序列预测,我想知道yhat(预测)列是如何计算的。我使用了以下代码。 import quandl import fbprophet tesla = q
我正在关注此处的多层感知器示例:https://github.com/aymericdamien/TensorFlow-Examples我对函数 tf.nn.softmax_cross_entropy
我是一名优秀的程序员,十分优秀!