计算机工程与应用 ›› 2019, Vol. 55 ›› Issue (20): 202-207.DOI: 10.3778/j.issn.1002-8331.1904-0007

• 工程与应用 • 上一篇    下一篇

改进的XGBoost模型在股票预测中的应用

王燕,郭元凯   

  1. 兰州理工大学 计算机与通信学院,兰州 730050
  • 出版日期:2019-10-15 发布日期:2019-10-14

Application of Improved XGBoost Model in Stock Forecasting

WANG Yan, GUO Yuankai   

  1. College of Computer and Communication, Lanzhou University of Technology, Lanzhou 730050, China
  • Online:2019-10-15 Published:2019-10-14

摘要: 随着时代的不断进步,人民生活水平日益提高。在解决温饱问题之余,有了可供投资的余财。越来越多的人将目光转向股市投资,为股市发展提供了资金条件。然而在纷繁复杂的股票市场,如何寻找最优股成为亟待解决的问题。这不仅是投资者单方面的困惑,也是股票预测领域中学者们所关心的重点。通过网格搜索算法对XGBoost模型进行参数优化构建GS-XGBoost的金融预测模型,并将该模型运用于股票短期预测中。分别以中国平安、中国建筑、中国中车、科大讯飞和三一重工2005年4月至2018年12月28日的每日收盘价作为实验数据。通过实验对比,相较于XGBoost原模型、GBDT模型以及SVM模型,GS-XGBoost模型在MSE、RMSE与MAE三个评价指标上都表现出较好的预测结果。从而验证,GS-XGBoost金融预测模型在股票短期预测中具有更好的拟合性能。

关键词: XGBoost, 网格搜索, 梯度增强决策树(GBDT), 支持向量机(SVM), 股价预测

Abstract: With the continuous advancement of the times, people’s living standards have been increasing. In addition to solving the problem of food and clothing, there is surplus money available for investment. More and more people are turning their attention to stock market investment, which provides financial conditions for the development of the stock market. However, in the complicated stock market, how to find the optimal stock has become an urgent problem to be solved. This is not only a unilateral confusion for investors, but also a focus of scholars in the field of stock forecasting. In this paper, the grid prediction algorithm is used to optimize the XGBoost model to construct the financial forecasting model of GS-XGBoost, and the model is applied to short-term stock forecasting. The daily closing prices of China Ping An, China State Construction Engineering Corporation, CRRC Corporation Limited, IFLYTEK and SANY HEAVY INDUSTRY from April 2005 to December 28, 2018 are used as experimental data. Through experimental comparison, compared with the original XGBoost model, GBDT model and SVM model, the GS-XGBoost model shows good prediction results on the three evaluation indexes of MSE, RMSE and MAE. It is verified that the GS-XGBoost financial forecasting model has better fitting performance in short-term stock forecasting.

Key words: XGBoost, grid search, Gradient Boosting Decision Tree(GBDT), Support Vector Machine(SVM), stock price forecast