时间序列-前移验证 (Time Series - Walk Forward Validation)
In time series modelling, the predictions over time become less and less accurate and hence it is a more realistic approach to re-train the model with actual data as it gets available for further predictions. Since training of statistical models are not time consuming, walk-forward validation is the most preferred solution to get most accurate results.
在时间序列建模中,随着时间的推移,预测变得越来越不准确,因此,当模型可用于进一步的预测时,采用实际数据重新训练模型是一种更为现实的方法。 由于训练统计模型并不耗时,因此,前向验证是获得最准确结果的最优选解决方案。
Let us apply one step walk forward validation on our data and compare it with the results we got earlier.
让我们对数据进行一步向前验证,并将其与我们之前获得的结果进行比较。
In [333]:
在[333]中:
prediction = []
data = train.values
for t In test.values:
model = (