程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Forecast, predict and get of Python ARIMA time series analysis_ prediction

編輯:Python

ARIMA forecast 、predict and get_prediction

By forecast And predict Trouble for a period of time , Opinions vary on the Internet .

Do data processing this time , A rough conclusion is drawn from the comparison , The use of parameters is not discussed in detail ( Please refer to the help document ):
edition :statsmodels 0.13.1

forecast Parameters steps, Indicates how many time points are predicted (fit After sample data ).
eg:
x=[1,2,3,4,5,6]

model.fit(x,y)
model.forecast(5), stay fit After the data sequence ( Out of sample ),forecast5 A little bit (x by 7,8,9,10,11)y Value .

predict Parameters (start,end) ,start Starting time ,end End point .
start 、 There is no limit to the end (in sample And out of sample All possible ),end Greater than start.
The values in the sample are fitted values , Outside the sample is the prediction .

If you only give one int value , Default view :
Greater than fit The last time point of the sample , Predict the value at this time .
Less than fit The last time point of the sample ,predict Current value to fit The last time point of the sample .

eg:
x=[1,2,3,4,5,6]

model.fit(x,y)
model.predict(2) #predict x be equal to 2,3,4,5,6 Of y
model.predict(7) #forecast x be equal to 7 Of y

get_prediction Basically the same predict
But the returned values are different . To view the forecast results, you need to use
.predicted_mean attribute

eg:
x=[1,2,3,4,5,6]

model.fit(x,y)
result=model.get_prediction(2)
result.predicted_mean # Return forecast results


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved