使用窗口数据集预测未来期间的时间序列中的值

问题描述 投票:-2回答:1

我拥有直到3650个时间步长的数据,但我想做出未来的预测,即3650个时间步长之后的数据。我是机器学习的新手,显然无法弄清楚。我该怎么做?以供参考,Colab Notebook

tensorflow machine-learning time-series data-science prediction
1个回答
0
投票
[如果您有兴趣,我们正在开发一个工具箱,它针对这些用例扩展了scikit-learn。因此,使用sktime,您可以简单地编写:

import numpy as np from sktime.datasets import load_airline from sktime.forecasting.compose import ReducedRegressionForecaster from sklearn.svm import RandomForestRegressor from sktime.forecasting.model_selection import temporal_train_test_split from sktime.performance_metrics.forecasting import smape_loss y = load_airline() # load 1-dimensional time series y_train, y_test = temporal_train_test_split(y) fh = np.arange(1, len(y_test) + 1) # forecasting horizon regressor = RandomForestRegressor() forecaster = ReducedRegressionForecaster(regressor, window_length=10) forecaster.fit(y_train) y_pred = forecaster.predict(fh) print(smape_loss(y_test, y_pred)) >>> 0.139046791779424

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.