Font Size: a A A

Research On Stock Forecasting Based On XGBoost Model

Posted on:2022-01-04Degree:MasterType:Thesis
Country:ChinaCandidate:C D GuoFull Text:PDF
GTID:2480306335478494Subject:Master of Applied Statistics
Abstract/Summary:PDF Full Text Request
Stock forecasting has always been a research hot spot,attracting many scholars from the fields of mathematics,statistics,economics and so on.Traditional analysis methods mainly include fundamental analysis and technical analysis.With the development of machine learning,quantitative analysis has become a new research method.This paper selects the XGBoost model proposed by Dr.Chen Tianqi in 2016 to make a short-term forecast of the stock price and trend.The original data comes from the tushare package of python and we selects 50 sample stocks in the Shanghai Stock Exchange 50 Index in 2019 as the research object.It has a total of 28509 data.Raw data indicators include date,opening price,closing price,highest price,lowest price and trading volume.After data acquisition,missing value detection and abnormal value detection are carried out to ensure the integrity and correctness of the original data,and then the index construction is carried out.This paper constructs a total of 9 indicators to expand the original index,and the data is divided into training set and test set.Finally,the training set and the test set are standardized to ensure the normalization of the data.In the modeling stage,the support vector machine is used to make a model on the standardized data set.Then the stock price prediction results of support vector machine model are standardized.The standardized data is merged into the original data set as an independent variable index.Finally,XGBoost model is used to make a model on the new data set,and the prediction result of XGBoost model is taken as the final result.In terms of model evaluation,MSE and decision coefficient are used to evaluate the regression problem of stock price prediction.For the classification problem of stock price trend prediction,F1 value and ROC curve are used to evaluate the model.The results show that XGBoost model has better prediction effect after using support vector machine to expand the original data.To a certain extent,support vector machine model can alleviate the over fitting of XGBoost model.The main achievement of this paper is to use support vector machine model to expand the original index.The prediction results of support vector machine model for stock price are input into XGBoost model as features,which improves the prediction effect of XGBoost model.The grid search algorithm is used to optimize the parameters of the above model,which further improves the prediction effect of the model.
Keywords/Search Tags:Stock forecast, Trend forecast, XGBoost, Support vector machine, Index expansion
PDF Full Text Request
Related items