小编Tom*_*rek的帖子

使用支持向量回归的时间序列预测

我一直在尝试使用python语言中的支持向量回归来实现时间序列预测工具.我使用scikit-learn的SVR模块进行非线性支持向量回归.但是我对未来事件的预测存在严重问题.回归线,只要我想预测未来的步骤符合原有功能大(从已知的数据),但是,它的最后一个已知的步骤返回值.

我的代码看起来像这样:

import numpy as np
from matplotlib import pyplot as plt
from sklearn.svm import SVR

X = np.arange(0,100)
Y = np.sin(X)

svr_rbf = SVR(kernel='rbf', C=1e5, gamma=1e5)
y_rbf = svr_rbf.fit(X[:-10, np.newaxis], Y[:-10]).predict(X[:, np.newaxis])

figure = plt.figure()
tick_plot = figure.add_subplot(1, 1, 1)
tick_plot.plot(X, Y, label='data', color='green', linestyle='-')
tick_plot.axvline(x=X[-10], alpha=0.2, color='gray')
tick_plot.plot(X, y_rbf, label='data', color='blue', linestyle='--')
plt.show()
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?
汤姆,提前谢谢

python regression time-series svm prediction

5
推荐指数
1
解决办法
5757
查看次数

标签 统计

prediction ×1

python ×1

regression ×1

svm ×1

time-series ×1