[英]Machine learning algorithm to predict next value
I am trying to predict the next value of a series. 我正在尝试预测系列的下一个价值。 What the best machine learning / algorithm I need to use?
我需要使用哪种最佳的机器学习/算法?
I have for example this matrix: 例如,我有这个矩阵:
[114, 160, 60, 27]
[74, 97, 73, 14]
[119, 157, 112, 23]
and I want to predict this values: 我想预测这个值:
[114, 160, 60, 27 , **80 , 90**]
[74, 97, 73, 14 , **10 , 15**]
[119, 157, 112, 23 , **50 , 48**]
What is the best way to do it? 最好的方法是什么?
If I understand well your question, in your case : 如果我很了解您的问题,就您而言:
X = [114, 160, 60, 27] and Y = [80,90] [74, 97, 73, 14] [10,15] [119, 157, 112, 23] [50,48]
And you want to fit a machine learning algorithm on this data ? 您想在此数据上使用机器学习算法吗?
You could use any supervied learning algo like regression or SVM using X as input and Y as output. 您可以使用任何高级学习算法,例如使用X作为输入而Y作为输出的回归或SVM。
You could also use iterative learning : you learn a predictor f
a step ahead with : 你也可以使用迭代学习:你学的预测
f
领先一步有:
X = [114, 160, 60, 27] and Y = [80] [74, 97, 73, 14] [10] [119, 157, 112, 23] [50]
You do the prediction one step ahead : 您可以提前进行预测:
f(X) = [pred1] [pred2] [pred3]
After that you incorporate the prediction in the input, so now you have : 之后,将预测合并到输入中,所以现在您有了:
Xbis = [114, 160, 60, 27, pred1] and Yter = [90] [74, 97, 73, 14,pred2] [15] [119, 157, 112, 23,pred3] [48]
And you train another predictor fbis
on Xbis and Ybis. 和你训练的另一个预测
fbis
对X b是和Ybis。
So at the end, you have two predictors f
and fbis
, both of them predicting one step ahead. 因此,最后有两个预测变量
f
和fbis
,它们都预测前进了一步。 It enables you to do prediction two step ahead. 它使您可以提前两步进行预测。 Of course, you will need more data to train a good predictor.
当然,您将需要更多数据来训练一个好的预测变量。
More generally, if you want to do time series prediction, you can use "the window method" which is a general method to create your input and output from the time series to then learn a predictor. 更一般而言,如果要进行时间序列预测,则可以使用“窗口方法”,这是一种通用方法,可以从时间序列创建输入和输出,然后学习预测变量。
Note also that LSTM are quite use in time series prediction and seems to give pretty good results. 还请注意,LSTM在时间序列预测中非常有用,并且似乎给出了很好的结果。
Hope this helps !! 希望这可以帮助 !!
Benoit 伯努瓦
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.