Stock market plays an important role in the economic development. Due to the complex volatility of the stock market, the research and prediction on the change of the stock price, can avoid the risk for the investors. The traditional time series model ARIMA can not describe the nonlinearity, and can not achieve satisfactory results in the stock prediction. As neural networks are with strong nonlinear generalization ability, this paper proposes an attention-based CNN-LSTM and XGBoost hybrid model to predict the stock price. The model constructed in this paper integrates the time series model, the Convolutional Neural Networks with Attention mechanism, the Long Short-Term Memory network, and XGBoost regressor in a non-linear relationship, and improves the prediction accuracy. The model can fully mine the historical information of the stock market in multiple periods. The stock data is first preprocessed through ARIMA. Then, the deep learning architecture formed in pretraining-finetuning framework is adopted. The pre-training model is the Attention-based CNN-LSTM model based on sequence-to-sequence framework. The model first uses convolution to extract the deep features of the original stock data, and then uses the Long Short-Term Memory networks to mine the long-term time series features. Finally, the XGBoost model is adopted for fine-tuning. The results show that the hybrid model is more effective and the prediction accuracy is relatively high, which can help investors or institutions to make decisions and achieve the purpose of expanding return and avoiding risk. Source code is available at https://github.com/zshicode/Attention-CLX-stock-prediction.
翻译:股票市场在经济发展中扮演着重要角色。由于股票市场存在复杂波动性,对股价变化的研究与预测能够帮助投资者规避风险。传统时间序列模型ARIMA无法描述非线性特征,在股票预测中难以取得满意效果。鉴于神经网络具有较强的非线性泛化能力,本文提出一种基于注意力机制的CNN-LSTM与XGBoost混合模型来预测股票价格。该模型通过非线性关系整合了时间序列模型、带有注意力机制的卷积神经网络、长短期记忆网络以及XGBoost回归器,从而提升了预测精度。该模型能够充分挖掘股票市场多时段的历史信息。首先通过ARIMA对股票数据进行预处理,随后采用预训练-微调框架构建深度学习架构。预训练模型是基于序列到序列框架的注意力机制CNN-LSTM模型:首先利用卷积层提取原始股票数据的深层特征,再通过长短期记忆网络挖掘长期时间序列特征。最后采用XGBoost模型进行微调。结果表明,该混合模型更为有效且预测精度较高,能够帮助投资者或机构进行决策,实现扩大收益与规避风险的目的。源代码可在https://github.com/zshicode/Attention-CLX-stock-prediction获取。