# Application and Comparison of Multiple Machine Learning Models in Finance

Authors: Yali Jiang
Journal: Scientific Programming
 (2022)

---

## Abstract

Accurate and effective financial data analysis is very important for investors to avoid risks and formulate profitable investment strategies. Therefore, the analysis of financial data has important research significance. However, the financial market is a complex nonlinear dynamic system affected by many factors. It is very challenging to analyze the financial data according to the obtained information. Among them, stock selection is the most typical financial data mining problem. The core of stock selection is to design a systematic scoring mechanism to quantitatively score stocks so as to more intuitively reflect the investment value of stocks. The scoring mechanism is based on the assumption that stocks with higher scores have higher investment value and stocks with lower scores have lower investment value. The stock selection model proposed in this paper mainly includes two steps: stock prediction and stock scoring. First, construct stock predictors and use machine learning forecasting methods to predict the future price of each stock. Second, construct a stock scoring mechanism to evaluate each stock through the predictive factors and financial factors in the previous step. Finally, select high-scoring stocks and make equal-weight investments. This paper applies the model to the empirical study of the A-share market, verifies its feasibility and effectiveness, and makes a systematic comparison with other benchmark models.


---

## Body

## 1. Introduction

With the development of the market economy, the issuance and trading of stocks occurred, and both promoted the development of the market economy. In recent years, stocks have shown their tenacious vitality, and the stock market has gradually become an indispensable part of the entire financial industry, especially the securities industry. In order to develop the national economy better and faster, as my country continues to enter the deep water zone of reforms, the reforms in the financial sector are gradually deepening [1]. Predicting the development of stocks has always been the direction of research and exploration by scholars from all walks of life. Predicting the development of stocks is a branch of prediction. The premise is to use scientific methods and methods, and it is necessary to know the development laws of financial markets, understand economics, and fully grasp the law of development of the financial market and the current stage of development [2].Faced with confusing, high-dimensional, and huge amounts of historical stock information, it is a reasonable and efficient way to analyze and process with the help of computers, which frees stock analysts from tedious work and concentrates on analyzing key issues [3]. The high-speed processing capability of the computer makes it possible to provide customers with more comprehensive and accurate forecasts in a short period of time. In addition, algorithms can provide insights into the forecasting problem from novel perspectives to achieve better forecasting results, which are beyond the reach of human analysis. Model algorithms such as machine learning and deep learning are suitable for the analysis of high-dimensional big data, and the use of computers to customize auxiliary software for stock forecasting for different service objects has become a research hotspot [4]. This paper will combine neural networks and support vector machines, two of the most widely used machine learning models, and propose improvements to provide novel solutions to problems such as model mixing and stock forecasting [5]. According to the existing stock analysis and prediction methods, the participation of the whole people can be maximized, and it is not necessary to have sufficient financial expertise to participate in stock investment. For research topics with special properties such as time series and high-dimensional stock historical data, many forecasting methods can be used for reference [6]. Therefore, the research topic of stock forecasting has very important significance from both theoretical and application perspectives and meets the current needs.


## 2. Preliminary Study

### 2.1. Problem Definition

The total data setD = {X, Y} is composed of the input factor X and the real label Y corresponding to the input factor X, and the prediction result Y is obtained by using the model F(·) to predict the data set D. When designing a specific prediction scheme, the input factor X and label Y can be differentiated according to the prediction model F(·) and the purpose of prediction. Therefore, the input factor X can be time series data, text data, binary features, and so on, and the label Y can be a specific value, classification result, and so on.Obviously, financial stock forecasting is a complex problem, which has the following five characteristics: (1) it is appropriate to use machine learning to analyze and predict financial stocks., and the input sources for stock prediction are huge, high-dimensional, and heterogeneous, and machine learning algorithms are particularly good at processing such data [7]; (2) indirect factors such as real-time data on the Internet and public sentiment will also affect the prediction results; (3) when considering numerical data as an input feature, the basic transaction data and the technical indicators calculated from the basic transaction data are huge and need to be selected, and in addition, the two features may affect each other; (4) each stock has its own specific development law, and the trained model algorithm is not necessarily applicable to the data sets of other stocks; and (5) for the prediction output, it can be divided into classification prediction and regression prediction according to the purpose of prediction. Classification and regression forecasts not only reflect trends and stock price forecasts but also provide new ideas for investment strategies and price reversal points [8].


### 2.2. BP Neural Network

The neural network model is currently the most widely used neural network. At the same time, the neural network has the ability to predict only after training and learning and can adapt to the prediction requirements, obtain the structure of learning knowledge, and map the nonlinearity to linear functions [9]. The main structure diagram and flowchart are shown in Figures 1 and 2.Figure 1
BP neural network structure diagram.Figure 2
Flow chart of BP neural network implementation.When the BP neural network predicts stocks, the time seriesi{X} is regarded as the input value of the input layer, and a part of it is selected for training. The price {Yi} obtained from the training result is compared with the actual price and adjusted by feedback. After multiple iterations, the prediction model is obtained, and then the price of a + b + c (c ≥ 1) at a certain time in the future is predicted. The nonlinear relationship of the price Ya+b+c time series at the predicted time can be expressed by the following formula:(1)Xa+b+c=fXa,Xa+1,……,Xa+b.The fitting modelf is obtained through the training set time series Xa + Xb + ⋯ + Xa+b, and the unvalued value is predicted from this.


### 2.3. Support Vector Machine Regression

Support vector machine (SVM) was first proposed by Vapnik et al. [10] Based on the “structural risk minimization” criterion, the optimal hyperplane is constructed to separate the two types of samples to the greatest extent. Support vector machine regression (SVR) is an extension of SVM [11]. The basic principle of SVR is similar to SVM, but its purpose is different. It aims to construct an optimal classification plane to minimize the error of all samples from the classification plane [12].There are n training samples, wherexi is the input variable and yi is the output variable. SVR can be regarded as a quadratic programming problem, as shown in the following equation:(2)min12w2,subject toyi−w⋅xi+b<ε,i=1,…,n,where ξ represents the boundary of the prediction error.In order to ensure the generalization ability of the model, slack variablesξi and ξi∗ are introduced to modify equation (2), namely,(3)min12w2+C∑i=1nξi+ξi∗,(4)subject toyi−w,xi−b≤ε+ξi,w,xi+b−yi≤ε+ξi∗,ξi,ξi∗≥0,whereC is the penalty factor, which is the maximum tolerance error.In order to solve equations (3) and (4), the Lagrange function is introduced and transformed into a dual problem as follows:(5)L=12w2+C∑i=1nξi+ξi∗−∑inλiε+ξi−yi+w,xi+b−∑inλi∗ε+ξi∗+yi−w,xi−b−∑i=1nηiξi+ηi∗ξi∗,∊ηi,ηi∗,ξi,ξi∗≥0.Solve the Lagrange equation and get the optimal solutionw∗ and b∗ as follows:(6)w∗=∑inλi−λi∗xi,b∗=yi−w∗,xi−ε,0≤λi≤C,i=1,…,n,b∗=yi−w∗,xi+ε,0≤λi∗≤C,i=1,…,n.


## 2.1. Problem Definition

The total data setD = {X, Y} is composed of the input factor X and the real label Y corresponding to the input factor X, and the prediction result Y is obtained by using the model F(·) to predict the data set D. When designing a specific prediction scheme, the input factor X and label Y can be differentiated according to the prediction model F(·) and the purpose of prediction. Therefore, the input factor X can be time series data, text data, binary features, and so on, and the label Y can be a specific value, classification result, and so on.Obviously, financial stock forecasting is a complex problem, which has the following five characteristics: (1) it is appropriate to use machine learning to analyze and predict financial stocks., and the input sources for stock prediction are huge, high-dimensional, and heterogeneous, and machine learning algorithms are particularly good at processing such data [7]; (2) indirect factors such as real-time data on the Internet and public sentiment will also affect the prediction results; (3) when considering numerical data as an input feature, the basic transaction data and the technical indicators calculated from the basic transaction data are huge and need to be selected, and in addition, the two features may affect each other; (4) each stock has its own specific development law, and the trained model algorithm is not necessarily applicable to the data sets of other stocks; and (5) for the prediction output, it can be divided into classification prediction and regression prediction according to the purpose of prediction. Classification and regression forecasts not only reflect trends and stock price forecasts but also provide new ideas for investment strategies and price reversal points [8].


## 2.2. BP Neural Network

The neural network model is currently the most widely used neural network. At the same time, the neural network has the ability to predict only after training and learning and can adapt to the prediction requirements, obtain the structure of learning knowledge, and map the nonlinearity to linear functions [9]. The main structure diagram and flowchart are shown in Figures 1 and 2.Figure 1
BP neural network structure diagram.Figure 2
Flow chart of BP neural network implementation.When the BP neural network predicts stocks, the time seriesi{X} is regarded as the input value of the input layer, and a part of it is selected for training. The price {Yi} obtained from the training result is compared with the actual price and adjusted by feedback. After multiple iterations, the prediction model is obtained, and then the price of a + b + c (c ≥ 1) at a certain time in the future is predicted. The nonlinear relationship of the price Ya+b+c time series at the predicted time can be expressed by the following formula:(1)Xa+b+c=fXa,Xa+1,……,Xa+b.The fitting modelf is obtained through the training set time series Xa + Xb + ⋯ + Xa+b, and the unvalued value is predicted from this.


## 2.3. Support Vector Machine Regression

Support vector machine (SVM) was first proposed by Vapnik et al. [10] Based on the “structural risk minimization” criterion, the optimal hyperplane is constructed to separate the two types of samples to the greatest extent. Support vector machine regression (SVR) is an extension of SVM [11]. The basic principle of SVR is similar to SVM, but its purpose is different. It aims to construct an optimal classification plane to minimize the error of all samples from the classification plane [12].There are n training samples, wherexi is the input variable and yi is the output variable. SVR can be regarded as a quadratic programming problem, as shown in the following equation:(2)min12w2,subject toyi−w⋅xi+b<ε,i=1,…,n,where ξ represents the boundary of the prediction error.In order to ensure the generalization ability of the model, slack variablesξi and ξi∗ are introduced to modify equation (2), namely,(3)min12w2+C∑i=1nξi+ξi∗,(4)subject toyi−w,xi−b≤ε+ξi,w,xi+b−yi≤ε+ξi∗,ξi,ξi∗≥0,whereC is the penalty factor, which is the maximum tolerance error.In order to solve equations (3) and (4), the Lagrange function is introduced and transformed into a dual problem as follows:(5)L=12w2+C∑i=1nξi+ξi∗−∑inλiε+ξi−yi+w,xi+b−∑inλi∗ε+ξi∗+yi−w,xi−b−∑i=1nηiξi+ηi∗ξi∗,∊ηi,ηi∗,ξi,ξi∗≥0.Solve the Lagrange equation and get the optimal solutionw∗ and b∗ as follows:(6)w∗=∑inλi−λi∗xi,b∗=yi−w∗,xi−ε,0≤λi≤C,i=1,…,n,b∗=yi−w∗,xi+ε,0≤λi∗≤C,i=1,…,n.


## 3. The Design of the Financial Stock Selection Model Based on Machine Learning Models

### 3.1. Stock Prediction Model Framework

The stock selection model proposed in this article mainly includes two steps: stock prediction (used to construct predictive factors) and stock scoring (used to evaluate stock value) [13–15]. The overall framework is shown in Figure 3.Figure 3
Framework diagram of the stock selection model.


### 3.2. Financial Stock Forecast and Scoring

#### 3.2.1. Financial Stock Forecast

In order to construct predictors, we predict the returns of all stocks. In the period oft, use zi,k,tk=1,2,…,17 transaction data to predict the stock price in period t+1 as follows [13]:(7)P^i,t+1=fzi,1,t,zi,2,t,…,zi,17,t,whereP^i,t+1 is the predicted price of stock i in period t + 1 and zi,k,t is the k-th transaction data of stock i in period t. A total of 17 trading factors are used to predict the future price of stocks. The 17 trading factors can be roughly divided into 4 categories. Volume and price factors include the previous day’s closing price, trading volume, opening price, average price, closing price, lowest price, turnover, and highest price [14]. Valuation factors include P/B ratio, P/B ratio, P/E ratio, and P/S ratio [15]. Risk factors include ups and downs of yuan, ups and downs, and turnover rate. Scale factors include total market capitalization and total equity. The predicted stock price P^i,t+1 is transformed into the predicted stock return through equation (10):(8)R^i,t+1=P^i,t+1−Pi,tPi,t,whereR^i,1 represents the predicted return of stock i in the period. Furthermore, normalize R^i,t+1 to obtain Y^i,t+1, and the process is shown in equation (11). Y^i,t+1 will be used as a predictor for the stock scoring in the second step.(9)Y^i,t+1=R^i,t+1−R^t+1D^t+1,whereR^-i=∑x∈1NR^i,t/N is the average value of the predictor and D^t=∑i=1XR^i,t−R^-t2/N is the standard deviation of the predictor, where N is the number of stocks.


#### 3.2.2. Financial Stock Scoring

In addition to predictive factors, financial factorsVi,j,rj=1,…,12 have also been introduced into our stock selection model. These factors are widely used in existing stock selection models, and they usually reflect the company’s operating conditions. For example, ROE usually reflects the company’s profitability; debt to equity ratio (DE) usually reflects the company’s bar ratio; current ratio (CR) usually reflects the company’s liquidity; and inventory turnover rate (ITR) usually reflects the company’s operating efficiency and operating income [16]. The growth rate OIG usually reflects the company’s growth and so on. As with forecasted earnings, standardize them as follows [17]:(10)Yi,j,t=Vi,j,t−V-j,tDj,t,whereV-j,t=∑i=1NVi,j,j/N is the average value of financial factors and Dj,t=∑i=1NVt,j,t−V-j,t,2/N is the standard deviation of the financial factor, where N is the number of stocks.The stock’si score in the period of t, si,t, can be described as a linear combination of predictive factors and financial factors as follows:(11)si,t=W0Y^i,t+1+∑j=1JWjYi,j,t,whereW0 represents the weight of the predictive factor, Wj represents the weight of the j financial factor, and si,t represents the comprehensive score of the stock in the period.Each stock is sorted according to its comprehensive score from high to low, denotingri,j∈1,2,…,N, if si,t≥sk,t, then ri,1≤rk, where i,k∈1,2,…,N represents any two separate stocks. In each period, the top m stocks are selected for equal-weight investment. The portfolio returns are as follows:(12)R¯t+1=1m∑ri,j=1mRt+1ri,t,ri,t=1,2,…,m,wherem is the number of stocks that the investor hopes to choose and Rt+1ri,t is the t return of the stocks selected during the period sorting in period t + 1. Rt+1 is the average return of stocks selected according to the model in t + 1.This research introduces Spread as the objective function (fitness function) of the model. The objective function (fitness function) is defined as the long-short portfolio return of the top stocks in thet period comprehensive score and the stocks after the m period comprehensive score.(13)minwjF=−1T∑t=1TSpreadt,Spreadt=∑ri,t=1mRt+1ri,t−∑ri,t=N−m+1NRt+1ri,tm.


### 3.3. Evaluation Indicator

Root mean square error (RMSE), mean absolute percentage error (MAPE), and directional statistics (D-STAT) are often used to evaluate the effectiveness of prediction models. This article also uses the above three indicators to evaluate the effectiveness of various prediction models in this article as follows [18]:(14)RMSE=1N⋅T′∑i=1N∑l=1Pi,t−P^i,t2,MAPE=1N⋅T′∑i=1N∑t=1T′Pi,1−P^i,tPi,t,Dstat=1N⋅T′∑i=1N∑t=1T′ai,t,whereT is the number of test periods, N is the number of stocks, Pi,t is the price of stock i in period t, P^i,t is the predicted price of the stock, and when Pi,t−Pi,t−1P^i,t−Pi,t−1>0, ai,t=1; otherwise it is 0. In addition, the running time of the model is also an important indicator for evaluating the performance of the model. It will cover the entire time of the training period and the test period.Choosing high-quality stocks for equal-weight investment means constructing an equal-weight investment portfolio. Portfolio income can most intuitively reflect the effectiveness of the stock selection model. The higher the portfolio return, the better the effect of the stock selection model. Therefore, this paper adopts the average return of all investment portfolios during the test period as one of the evaluation indicators of the stock selection model. In addition, portfolio risk is also a key concern. SharpeRatio is a commonly used indicator to describe portfolio risk. This article also uses SharpeRatio as one of the evaluation indicators of the stock selection model. The specific calculation formula is as follows [19]:(15)AR=1T′∑t=1T′R-t+1,Sharpe Ratio=ER-t−Rifσ.whereR¯1 is the average return of the portfolio in the t period, that is, the average value of the strategy return; Rif is the risk-free return in the t period; ER-t−Rif is the expectation; and σ is the portfolio volatility, that is, the strategy return.


### 3.4. Hyperparameter Setting

All parameters involved in the model and benchmark model proposed in this paper refer to previous studies, as shown in Table1. Regardless of whether it is an optimization model or a prediction model, there are random variables or parameters, and different optimization values will be generated every time the model is run (the output result cannot be guaranteed to be the optimal result). Therefore, all models are run 30 times for each case, and their average value is used as the final output result.Table 1
Parameter settings of this model and benchmark model.
OptimizationParameterValueMethod of predictionParameterValueDEP30ELMN0.1∗N_trainCr0.5TFsigF0.6n10GAP50BPNNep3,000cr0.6lr0.1mr0.5mc0.4PSOP40KRBFc1 = c21.495SVRr{2−15, 2−13, …, 213, …, 215}wn[0.4, 0.9]C{2−15, 2−13, …, 213, …, 215}Note:γ and C are traversed from the grid of 2−15,2−13,…,213,215 to obtain values. N−train is the number of training periods of the extreme learning machine. For other parameter descriptions, please refer to the description of symbols and abbreviations.


## 3.1. Stock Prediction Model Framework

The stock selection model proposed in this article mainly includes two steps: stock prediction (used to construct predictive factors) and stock scoring (used to evaluate stock value) [13–15]. The overall framework is shown in Figure 3.Figure 3
Framework diagram of the stock selection model.


## 3.2. Financial Stock Forecast and Scoring

### 3.2.1. Financial Stock Forecast

In order to construct predictors, we predict the returns of all stocks. In the period oft, use zi,k,tk=1,2,…,17 transaction data to predict the stock price in period t+1 as follows [13]:(7)P^i,t+1=fzi,1,t,zi,2,t,…,zi,17,t,whereP^i,t+1 is the predicted price of stock i in period t + 1 and zi,k,t is the k-th transaction data of stock i in period t. A total of 17 trading factors are used to predict the future price of stocks. The 17 trading factors can be roughly divided into 4 categories. Volume and price factors include the previous day’s closing price, trading volume, opening price, average price, closing price, lowest price, turnover, and highest price [14]. Valuation factors include P/B ratio, P/B ratio, P/E ratio, and P/S ratio [15]. Risk factors include ups and downs of yuan, ups and downs, and turnover rate. Scale factors include total market capitalization and total equity. The predicted stock price P^i,t+1 is transformed into the predicted stock return through equation (10):(8)R^i,t+1=P^i,t+1−Pi,tPi,t,whereR^i,1 represents the predicted return of stock i in the period. Furthermore, normalize R^i,t+1 to obtain Y^i,t+1, and the process is shown in equation (11). Y^i,t+1 will be used as a predictor for the stock scoring in the second step.(9)Y^i,t+1=R^i,t+1−R^t+1D^t+1,whereR^-i=∑x∈1NR^i,t/N is the average value of the predictor and D^t=∑i=1XR^i,t−R^-t2/N is the standard deviation of the predictor, where N is the number of stocks.


### 3.2.2. Financial Stock Scoring

In addition to predictive factors, financial factorsVi,j,rj=1,…,12 have also been introduced into our stock selection model. These factors are widely used in existing stock selection models, and they usually reflect the company’s operating conditions. For example, ROE usually reflects the company’s profitability; debt to equity ratio (DE) usually reflects the company’s bar ratio; current ratio (CR) usually reflects the company’s liquidity; and inventory turnover rate (ITR) usually reflects the company’s operating efficiency and operating income [16]. The growth rate OIG usually reflects the company’s growth and so on. As with forecasted earnings, standardize them as follows [17]:(10)Yi,j,t=Vi,j,t−V-j,tDj,t,whereV-j,t=∑i=1NVi,j,j/N is the average value of financial factors and Dj,t=∑i=1NVt,j,t−V-j,t,2/N is the standard deviation of the financial factor, where N is the number of stocks.The stock’si score in the period of t, si,t, can be described as a linear combination of predictive factors and financial factors as follows:(11)si,t=W0Y^i,t+1+∑j=1JWjYi,j,t,whereW0 represents the weight of the predictive factor, Wj represents the weight of the j financial factor, and si,t represents the comprehensive score of the stock in the period.Each stock is sorted according to its comprehensive score from high to low, denotingri,j∈1,2,…,N, if si,t≥sk,t, then ri,1≤rk, where i,k∈1,2,…,N represents any two separate stocks. In each period, the top m stocks are selected for equal-weight investment. The portfolio returns are as follows:(12)R¯t+1=1m∑ri,j=1mRt+1ri,t,ri,t=1,2,…,m,wherem is the number of stocks that the investor hopes to choose and Rt+1ri,t is the t return of the stocks selected during the period sorting in period t + 1. Rt+1 is the average return of stocks selected according to the model in t + 1.This research introduces Spread as the objective function (fitness function) of the model. The objective function (fitness function) is defined as the long-short portfolio return of the top stocks in thet period comprehensive score and the stocks after the m period comprehensive score.(13)minwjF=−1T∑t=1TSpreadt,Spreadt=∑ri,t=1mRt+1ri,t−∑ri,t=N−m+1NRt+1ri,tm.


## 3.2.1. Financial Stock Forecast

In order to construct predictors, we predict the returns of all stocks. In the period oft, use zi,k,tk=1,2,…,17 transaction data to predict the stock price in period t+1 as follows [13]:(7)P^i,t+1=fzi,1,t,zi,2,t,…,zi,17,t,whereP^i,t+1 is the predicted price of stock i in period t + 1 and zi,k,t is the k-th transaction data of stock i in period t. A total of 17 trading factors are used to predict the future price of stocks. The 17 trading factors can be roughly divided into 4 categories. Volume and price factors include the previous day’s closing price, trading volume, opening price, average price, closing price, lowest price, turnover, and highest price [14]. Valuation factors include P/B ratio, P/B ratio, P/E ratio, and P/S ratio [15]. Risk factors include ups and downs of yuan, ups and downs, and turnover rate. Scale factors include total market capitalization and total equity. The predicted stock price P^i,t+1 is transformed into the predicted stock return through equation (10):(8)R^i,t+1=P^i,t+1−Pi,tPi,t,whereR^i,1 represents the predicted return of stock i in the period. Furthermore, normalize R^i,t+1 to obtain Y^i,t+1, and the process is shown in equation (11). Y^i,t+1 will be used as a predictor for the stock scoring in the second step.(9)Y^i,t+1=R^i,t+1−R^t+1D^t+1,whereR^-i=∑x∈1NR^i,t/N is the average value of the predictor and D^t=∑i=1XR^i,t−R^-t2/N is the standard deviation of the predictor, where N is the number of stocks.


## 3.2.2. Financial Stock Scoring

In addition to predictive factors, financial factorsVi,j,rj=1,…,12 have also been introduced into our stock selection model. These factors are widely used in existing stock selection models, and they usually reflect the company’s operating conditions. For example, ROE usually reflects the company’s profitability; debt to equity ratio (DE) usually reflects the company’s bar ratio; current ratio (CR) usually reflects the company’s liquidity; and inventory turnover rate (ITR) usually reflects the company’s operating efficiency and operating income [16]. The growth rate OIG usually reflects the company’s growth and so on. As with forecasted earnings, standardize them as follows [17]:(10)Yi,j,t=Vi,j,t−V-j,tDj,t,whereV-j,t=∑i=1NVi,j,j/N is the average value of financial factors and Dj,t=∑i=1NVt,j,t−V-j,t,2/N is the standard deviation of the financial factor, where N is the number of stocks.The stock’si score in the period of t, si,t, can be described as a linear combination of predictive factors and financial factors as follows:(11)si,t=W0Y^i,t+1+∑j=1JWjYi,j,t,whereW0 represents the weight of the predictive factor, Wj represents the weight of the j financial factor, and si,t represents the comprehensive score of the stock in the period.Each stock is sorted according to its comprehensive score from high to low, denotingri,j∈1,2,…,N, if si,t≥sk,t, then ri,1≤rk, where i,k∈1,2,…,N represents any two separate stocks. In each period, the top m stocks are selected for equal-weight investment. The portfolio returns are as follows:(12)R¯t+1=1m∑ri,j=1mRt+1ri,t,ri,t=1,2,…,m,wherem is the number of stocks that the investor hopes to choose and Rt+1ri,t is the t return of the stocks selected during the period sorting in period t + 1. Rt+1 is the average return of stocks selected according to the model in t + 1.This research introduces Spread as the objective function (fitness function) of the model. The objective function (fitness function) is defined as the long-short portfolio return of the top stocks in thet period comprehensive score and the stocks after the m period comprehensive score.(13)minwjF=−1T∑t=1TSpreadt,Spreadt=∑ri,t=1mRt+1ri,t−∑ri,t=N−m+1NRt+1ri,tm.


## 3.3. Evaluation Indicator

Root mean square error (RMSE), mean absolute percentage error (MAPE), and directional statistics (D-STAT) are often used to evaluate the effectiveness of prediction models. This article also uses the above three indicators to evaluate the effectiveness of various prediction models in this article as follows [18]:(14)RMSE=1N⋅T′∑i=1N∑l=1Pi,t−P^i,t2,MAPE=1N⋅T′∑i=1N∑t=1T′Pi,1−P^i,tPi,t,Dstat=1N⋅T′∑i=1N∑t=1T′ai,t,whereT is the number of test periods, N is the number of stocks, Pi,t is the price of stock i in period t, P^i,t is the predicted price of the stock, and when Pi,t−Pi,t−1P^i,t−Pi,t−1>0, ai,t=1; otherwise it is 0. In addition, the running time of the model is also an important indicator for evaluating the performance of the model. It will cover the entire time of the training period and the test period.Choosing high-quality stocks for equal-weight investment means constructing an equal-weight investment portfolio. Portfolio income can most intuitively reflect the effectiveness of the stock selection model. The higher the portfolio return, the better the effect of the stock selection model. Therefore, this paper adopts the average return of all investment portfolios during the test period as one of the evaluation indicators of the stock selection model. In addition, portfolio risk is also a key concern. SharpeRatio is a commonly used indicator to describe portfolio risk. This article also uses SharpeRatio as one of the evaluation indicators of the stock selection model. The specific calculation formula is as follows [19]:(15)AR=1T′∑t=1T′R-t+1,Sharpe Ratio=ER-t−Rifσ.whereR¯1 is the average return of the portfolio in the t period, that is, the average value of the strategy return; Rif is the risk-free return in the t period; ER-t−Rif is the expectation; and σ is the portfolio volatility, that is, the strategy return.


## 3.4. Hyperparameter Setting

All parameters involved in the model and benchmark model proposed in this paper refer to previous studies, as shown in Table1. Regardless of whether it is an optimization model or a prediction model, there are random variables or parameters, and different optimization values will be generated every time the model is run (the output result cannot be guaranteed to be the optimal result). Therefore, all models are run 30 times for each case, and their average value is used as the final output result.Table 1
Parameter settings of this model and benchmark model.
OptimizationParameterValueMethod of predictionParameterValueDEP30ELMN0.1∗N_trainCr0.5TFsigF0.6n10GAP50BPNNep3,000cr0.6lr0.1mr0.5mc0.4PSOP40KRBFc1 = c21.495SVRr{2−15, 2−13, …, 213, …, 215}wn[0.4, 0.9]C{2−15, 2−13, …, 213, …, 215}Note:γ and C are traversed from the grid of 2−15,2−13,…,213,215 to obtain values. N−train is the number of training periods of the extreme learning machine. For other parameter descriptions, please refer to the description of symbols and abbreviations.


## 4. Experimental Test and Result Comparison

### 4.1. Experimental Data Set

The trading volume and total market value of China’s A-share market in the global financial market are increasing day by day, and its status is increasing day by day. Therefore, the A-share band field is selected as the experimental sample of this article. There are a total of 2,473 stocks as candidate stocks for the investment portfolio, which excludes financial industry stocks with different balance sheet structures and specially processed stocks ST that may be unstable. In the existing stock forecasting models, this chapter will introduce the acquisition, processing, and cleaning of data sources from two aspects of stock index data and text data. Among them, stock index data refers to data related to stock trading. The text data mainly consists of news data. The trading data used for stock forecasting and the financial data of stock scoring are all quarterly data, and they all come from the Wind database.


### 4.2. Benchmark Model Comparison

As shown in Table2, this article introduces a variety of benchmark models, including different prediction models (marked as M1), different factorial designs (marked as M2), different optimization algorithms (marked as M3), and different fitness functions (marked as M4). Among them, M0 is the stock selection model proposed in this article. Next, we will introduce the construction methods of various benchmark models in detail.Table 2
Benchmark model design.
TypeDescribePredictive modelFactorial designOptimizationFitness functionM0Stock selection modelELMA0DESpreadM1Benchmark model: different forecasting modelsBPNNA0DESpreadSVRA0DESpreadM2Benchmark model: different factorial designsELMA1DESpreadELMA2DESpreadM3Benchmark model: different optimization algorithmsELMA0PSOSpreadELMA0GASpreadM4Benchmark model: different fitness functionsELMA0DEICELMA0DECRELMA0DEIFHRELMA0DEWINIn each benchmark method, in order to ensure the fairness of comparison, each type of benchmark model only changes its unique variable. For type M1, BP neural network (BPNN) and support vector machine regression (SVR) are two classic forecasting models, which are widely used in stock forecasting, investment portfolio, and stock selection research. Therefore, this article will introduce these two prediction models as the benchmark model. For type M2, the model proposed in this paper contains two types of factors, namely, basic factors and predictive factors, which are denoted as A0. Two new designs are now introduced as the benchmark model of this article. Design A1 means that only financial factors are considered but not predictive factors, and design A2 means that only predictive factors are considered but not financial factors. For type M3, the more popular intelligent optimization algorithm in the stock selection model is introduced as the benchmark model of this article, namely, genetic algorithm GA and particle swarm algorithm PSO. For type M4, in the stock selection model based on the intelligent optimization algorithm, four commonly used optimization objective functions (fitness functions) are used as the benchmark model of this article, namely, information coefficient (IC), equity (CR), long-short combination winning rate (IFHR), and absolute win rate (WIN).(16)IC=−1T∑t=1Tcovri,t,,ri,t′varri,tvarri,t′,CR=−∏i=1T1+R-t+1,IFHR=−1T∑t=1T∑ri,t=1msgnRt+1ri,t−Mt+12m−∑ri,t=N−m+1NsgnRt+1ri,t−Mi+12m,WIN=−1T∑t=1T∑R-t+1sgn,whereT is the number of training periods, ri,t is the ranking of stock i in the t-th period, ri,t is the stock’s income ranking in t + 1 period, cov⋅ is the covariance, var⋅ is the variance, m is to select the number of stocks, and R¯t+1 is the average return of the stock selection strategy in the t + 1 period. It outputs 1 when it is x>0; otherwise, it outputs 0. See Table 1 for benchmark model design.


#### 4.2.1. Comparison of Different Prediction Models (M1)

When constructing predictors, this article uses the extreme learning machine ELM to predict stock prices. In order to prove the effectiveness of ELM in stock forecasting, two classic forecasting methods, BP neural network (BPNN) and support vector machine regression (SVR), are introduced as benchmark models. Table3 shows the prediction results. Among them, Prob.(R1) is the probability that the stock selection model of this article will have a higher quarterly return than the quarterly earnings of R1; Prob.(R2) is the probability that the quarterly earnings of the stock selection model of this article will be higher than the quarterly earnings of R2; and Max. is the average value of the maximum return of the stock selection model of this article; Min. is the average value of the minimum return of the stock selection model of this article; and HitRate represents the probability of the model obtaining a positive return [20].Table 3
Comparison results of different forecasting methods in the stock selection model.
ModelELMBPNNSVRModule A: performance of stock-picking modelAR0.09980.08770.0799SharpeRatio0.40540.29970.3049Max.0.41990.40890.4278Min.−0.3178−0.3203−0.3049Prob.(R1)0.65540.47120.5083Prob.(R2)0.78310.75000.7521HitRatio0.76030.75800.5813Module B: t testH0:ARELM≤ARBenchmarkPositive test (p value)0.31210.20140.4179t-statNA18.143313.2240p valueNA<0.0001<0.0001Module C: stock forecastComputing time60.122216,100.254132,399.8999D-STAT0.51480.49970.4978MAPE0.21890.25780.4001RMSE18.999732.235944.8972Module D: DM test (H0: the prediction result based on the benchmark model is better than the prediction result based on ELM)DM-STATNA−17.2012−5.001p valueNA<0.0001<0.0001As shown in module A in Table3, the stock selection model using ELM performs more prominently in AR, SharpeRatio, Prob.(R1), Prob.(R2), and HitRatio. At the same time, the SVR stock selection model has achieved a little advantage in Max. and Min. while the stock selection model of BPNN is at a disadvantage in any evaluation index. This shows that the predictive factors constructed by ELM can better assist stock selection decisions. In order to statistically prove that the stock selection model using ELM is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Second, construct a null hypothesis, H0: the AR of the stock selection model using ELM is significantly lower than other benchmark models. According to module B, all models pass the normality test, and the values of all models are less than 5%. It shows that at the 95% confidence level, the stock selection model based on ELM is better than the benchmark model. This proves that the predictive factors constructed by ELM can better assist stock selection decision-making.Module C shows the evaluation indicators of all forecasting methods. Obviously, the method of using ELM to predict stock prices crushes all benchmark models in computing time, directional accuracy D-STAT, prediction accuracy MAPE, and RMSE. In the research of this article, ELM has more prominent predictive abilities. Similarly, in order to statistically prove that the prediction results based on the extreme learning machine ELM are significantly better than other benchmark models, this section conducts the Diebold–Mariano test (DM test) on each benchmark model. The process is as follows: construct a null hypothesis, H0: the prediction result based on ELM is significantly lower than the prediction result based on the benchmark model. The DM test results are shown in module D in Table3. All values are less than 5%, indicating that the prediction results based on ELM are better than the benchmark model at the 95% confidence level. This proves that ELM has a stronger predictive ability. It can be seen that the predictor based on ELM structure can better assist stock selection decision-making.


#### 4.2.2. Comparison of Different Factorial Designs (M3)

The innovation of the stock selection model proposed in this paper is the use of predictive factors and financial factors to evaluate the value of stocks. The predictive factors contain the future information of the stock market, and the basic factors contain historical information of the stock. In order to prove the effectiveness of this innovative design, the proposed stock selection model A0 is compared with the benchmark model A1 and the benchmark model A2 (as shown in Table4). Among them, the benchmark model A1 only uses basic factors, similar to the traditional stock selection model, for which refer to the research done by Huang, and the benchmark model A2 only uses predictive factors, for which refer to the research done by Huang and Quah.Table 4
Comparison results of different factorial designs in the stock selection model.
ModelA0A1A2R1R2Module A: model performanceAR0.11020.07650.07990.84030.0398SharpeRatio0.40100.29970.30120.29880.1798Max.0.45870.40990.40100.37890.3594Min.−0.2998−0.3201−0.3587−0.3099−0.3178Prob.(R1)0.65490.43780.5001NA0.0000Prob.(R2)0.80010.76030.75541.0000NAHitRatio0.76020.78120.73990.78490.5645Module B: t-testH0:ARDF≤ARBenchmarkNormality test (p value)0.29980.04890.3379NANAt statNA20.587914.133925.899957.0004p valueNA<0.0001<0.0001<0.0001<0.0001Table4 shows the relevant results. At the same time, the A0 stock selection model has achieved outstanding performance in AR, SharpeRatio, Min., and Prob.(R1). However, only the A1 stock selection model and the A2 stock selection model have no outstanding performance in the various evaluation indicators. In order to statistically prove that the stock selection model using A0 is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Secondly, construct a null hypothesis, H0: the average return AR of the stock selection model A0 using predictive factors and financial factors is significantly lower than other benchmark models. According to module B, all models pass the normality test, and the values of all models are less than 5%. It shows that under the 95% confidence level, the stock selection model A0 using predictive factors and financial factors is better than other benchmark models. This proves that adding predictive factors can better assist stock selection decisions, and financial factors are equally important.


#### 4.2.3. Comparison of Different Optimization Algorithms (M3)

In this paper, the differential evolution algorithm is used to optimize the weights of various factors. In order to prove the effectiveness of DE, the classic genetic algorithm GA and particle swarm algorithm PSO are set as the benchmark model. As shown in Table5, during the training and testing period, the DE stock selection model used in this paper is superior in average return AR and SharpeRatio, which not only shows that DE algorithm can better assist stock selection decision-making but also shows that the algorithm can achieve the best performance. The optimized factor weights have stronger generalization ability than the benchmark model. In order to statistically prove that the stock selection model adopted is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Secondly, construct a null hypothesis, H0: the AR of the stock selection model using DE is significantly lower than other benchmark models. As shown in the module, all models passed the normality test, and the values of all models were less than 5%. It shows that under the 95% confidence level, the DE-based stock selection model is better than other benchmark models. Thus, it is statistically proved that the differential evolution algorithm can better assist the stock selection decision-making.Table 5
Comparison results of different optimization algorithms in the stock selection model.
ModelTraining setTest sett-test H0:ARDF≤ARBenchmarkARSharpRatioARSharpRatioNormality test (p value)t-statp valueDE0.12010.13110.10780.36440.2988NANAPSO0.18870.10880.12440.35770.49993.79940.0002GA0.10010.10220.10120.35780.19944.3829<0.0001


#### 4.2.4. Comparison of Different Fitness Functions (M4)

In this paper, the Spread fitness function (old standard han number) is used to make stock selection decisions, and four different fitness functions such as IC, CR, IFHR, and WIN are now used as benchmark models. The results are shown in Table6. The stock selection model using the Spread fitness function has outstanding performance in average return AR and Sharpe Ratio. The stock selection model using the Spread fitness function can better assist stock selection decisions. In order to statistically prove that the stock selection model using Spread is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: First, the Han-state test is performed on each model, and the normality test is the prerequisite for the test. Second, construct a null hypothesis, H0: the average return AR of Spread’s stock selection model is significantly lower than other benchmark models. According to the module, all models pass the normality test, and the values of all models are less than 5%. This shows that at the 95% confidence level, the stock selection model based on Spread is better than other benchmark models. Thus, it is statistically proved that the stock selection model using the Spread fitness function can better assist stock selection decision-making.Table 6
The comparison result of the fitness function in the stock selection model is the difference.
ModelSpreadICCRIFHRWINModule A: model performanceAR0.11090.08120.08990.11350.0898SharpeRatio0.37890.29780.35760.34770.3396Module: inspectionH0:ARSprear≤ARBenchmarkNormality test (p value)0.29970.38890.12990.37510.4999t-statNA18.443619.13243.11627.1124p valueNA<0.0001<0.00010.0013<0.0001


## 4.1. Experimental Data Set

The trading volume and total market value of China’s A-share market in the global financial market are increasing day by day, and its status is increasing day by day. Therefore, the A-share band field is selected as the experimental sample of this article. There are a total of 2,473 stocks as candidate stocks for the investment portfolio, which excludes financial industry stocks with different balance sheet structures and specially processed stocks ST that may be unstable. In the existing stock forecasting models, this chapter will introduce the acquisition, processing, and cleaning of data sources from two aspects of stock index data and text data. Among them, stock index data refers to data related to stock trading. The text data mainly consists of news data. The trading data used for stock forecasting and the financial data of stock scoring are all quarterly data, and they all come from the Wind database.


## 4.2. Benchmark Model Comparison

As shown in Table2, this article introduces a variety of benchmark models, including different prediction models (marked as M1), different factorial designs (marked as M2), different optimization algorithms (marked as M3), and different fitness functions (marked as M4). Among them, M0 is the stock selection model proposed in this article. Next, we will introduce the construction methods of various benchmark models in detail.Table 2
Benchmark model design.
TypeDescribePredictive modelFactorial designOptimizationFitness functionM0Stock selection modelELMA0DESpreadM1Benchmark model: different forecasting modelsBPNNA0DESpreadSVRA0DESpreadM2Benchmark model: different factorial designsELMA1DESpreadELMA2DESpreadM3Benchmark model: different optimization algorithmsELMA0PSOSpreadELMA0GASpreadM4Benchmark model: different fitness functionsELMA0DEICELMA0DECRELMA0DEIFHRELMA0DEWINIn each benchmark method, in order to ensure the fairness of comparison, each type of benchmark model only changes its unique variable. For type M1, BP neural network (BPNN) and support vector machine regression (SVR) are two classic forecasting models, which are widely used in stock forecasting, investment portfolio, and stock selection research. Therefore, this article will introduce these two prediction models as the benchmark model. For type M2, the model proposed in this paper contains two types of factors, namely, basic factors and predictive factors, which are denoted as A0. Two new designs are now introduced as the benchmark model of this article. Design A1 means that only financial factors are considered but not predictive factors, and design A2 means that only predictive factors are considered but not financial factors. For type M3, the more popular intelligent optimization algorithm in the stock selection model is introduced as the benchmark model of this article, namely, genetic algorithm GA and particle swarm algorithm PSO. For type M4, in the stock selection model based on the intelligent optimization algorithm, four commonly used optimization objective functions (fitness functions) are used as the benchmark model of this article, namely, information coefficient (IC), equity (CR), long-short combination winning rate (IFHR), and absolute win rate (WIN).(16)IC=−1T∑t=1Tcovri,t,,ri,t′varri,tvarri,t′,CR=−∏i=1T1+R-t+1,IFHR=−1T∑t=1T∑ri,t=1msgnRt+1ri,t−Mt+12m−∑ri,t=N−m+1NsgnRt+1ri,t−Mi+12m,WIN=−1T∑t=1T∑R-t+1sgn,whereT is the number of training periods, ri,t is the ranking of stock i in the t-th period, ri,t is the stock’s income ranking in t + 1 period, cov⋅ is the covariance, var⋅ is the variance, m is to select the number of stocks, and R¯t+1 is the average return of the stock selection strategy in the t + 1 period. It outputs 1 when it is x>0; otherwise, it outputs 0. See Table 1 for benchmark model design.


### 4.2.1. Comparison of Different Prediction Models (M1)

When constructing predictors, this article uses the extreme learning machine ELM to predict stock prices. In order to prove the effectiveness of ELM in stock forecasting, two classic forecasting methods, BP neural network (BPNN) and support vector machine regression (SVR), are introduced as benchmark models. Table3 shows the prediction results. Among them, Prob.(R1) is the probability that the stock selection model of this article will have a higher quarterly return than the quarterly earnings of R1; Prob.(R2) is the probability that the quarterly earnings of the stock selection model of this article will be higher than the quarterly earnings of R2; and Max. is the average value of the maximum return of the stock selection model of this article; Min. is the average value of the minimum return of the stock selection model of this article; and HitRate represents the probability of the model obtaining a positive return [20].Table 3
Comparison results of different forecasting methods in the stock selection model.
ModelELMBPNNSVRModule A: performance of stock-picking modelAR0.09980.08770.0799SharpeRatio0.40540.29970.3049Max.0.41990.40890.4278Min.−0.3178−0.3203−0.3049Prob.(R1)0.65540.47120.5083Prob.(R2)0.78310.75000.7521HitRatio0.76030.75800.5813Module B: t testH0:ARELM≤ARBenchmarkPositive test (p value)0.31210.20140.4179t-statNA18.143313.2240p valueNA<0.0001<0.0001Module C: stock forecastComputing time60.122216,100.254132,399.8999D-STAT0.51480.49970.4978MAPE0.21890.25780.4001RMSE18.999732.235944.8972Module D: DM test (H0: the prediction result based on the benchmark model is better than the prediction result based on ELM)DM-STATNA−17.2012−5.001p valueNA<0.0001<0.0001As shown in module A in Table3, the stock selection model using ELM performs more prominently in AR, SharpeRatio, Prob.(R1), Prob.(R2), and HitRatio. At the same time, the SVR stock selection model has achieved a little advantage in Max. and Min. while the stock selection model of BPNN is at a disadvantage in any evaluation index. This shows that the predictive factors constructed by ELM can better assist stock selection decisions. In order to statistically prove that the stock selection model using ELM is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Second, construct a null hypothesis, H0: the AR of the stock selection model using ELM is significantly lower than other benchmark models. According to module B, all models pass the normality test, and the values of all models are less than 5%. It shows that at the 95% confidence level, the stock selection model based on ELM is better than the benchmark model. This proves that the predictive factors constructed by ELM can better assist stock selection decision-making.Module C shows the evaluation indicators of all forecasting methods. Obviously, the method of using ELM to predict stock prices crushes all benchmark models in computing time, directional accuracy D-STAT, prediction accuracy MAPE, and RMSE. In the research of this article, ELM has more prominent predictive abilities. Similarly, in order to statistically prove that the prediction results based on the extreme learning machine ELM are significantly better than other benchmark models, this section conducts the Diebold–Mariano test (DM test) on each benchmark model. The process is as follows: construct a null hypothesis, H0: the prediction result based on ELM is significantly lower than the prediction result based on the benchmark model. The DM test results are shown in module D in Table3. All values are less than 5%, indicating that the prediction results based on ELM are better than the benchmark model at the 95% confidence level. This proves that ELM has a stronger predictive ability. It can be seen that the predictor based on ELM structure can better assist stock selection decision-making.


### 4.2.2. Comparison of Different Factorial Designs (M3)

The innovation of the stock selection model proposed in this paper is the use of predictive factors and financial factors to evaluate the value of stocks. The predictive factors contain the future information of the stock market, and the basic factors contain historical information of the stock. In order to prove the effectiveness of this innovative design, the proposed stock selection model A0 is compared with the benchmark model A1 and the benchmark model A2 (as shown in Table4). Among them, the benchmark model A1 only uses basic factors, similar to the traditional stock selection model, for which refer to the research done by Huang, and the benchmark model A2 only uses predictive factors, for which refer to the research done by Huang and Quah.Table 4
Comparison results of different factorial designs in the stock selection model.
ModelA0A1A2R1R2Module A: model performanceAR0.11020.07650.07990.84030.0398SharpeRatio0.40100.29970.30120.29880.1798Max.0.45870.40990.40100.37890.3594Min.−0.2998−0.3201−0.3587−0.3099−0.3178Prob.(R1)0.65490.43780.5001NA0.0000Prob.(R2)0.80010.76030.75541.0000NAHitRatio0.76020.78120.73990.78490.5645Module B: t-testH0:ARDF≤ARBenchmarkNormality test (p value)0.29980.04890.3379NANAt statNA20.587914.133925.899957.0004p valueNA<0.0001<0.0001<0.0001<0.0001Table4 shows the relevant results. At the same time, the A0 stock selection model has achieved outstanding performance in AR, SharpeRatio, Min., and Prob.(R1). However, only the A1 stock selection model and the A2 stock selection model have no outstanding performance in the various evaluation indicators. In order to statistically prove that the stock selection model using A0 is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Secondly, construct a null hypothesis, H0: the average return AR of the stock selection model A0 using predictive factors and financial factors is significantly lower than other benchmark models. According to module B, all models pass the normality test, and the values of all models are less than 5%. It shows that under the 95% confidence level, the stock selection model A0 using predictive factors and financial factors is better than other benchmark models. This proves that adding predictive factors can better assist stock selection decisions, and financial factors are equally important.


### 4.2.3. Comparison of Different Optimization Algorithms (M3)

In this paper, the differential evolution algorithm is used to optimize the weights of various factors. In order to prove the effectiveness of DE, the classic genetic algorithm GA and particle swarm algorithm PSO are set as the benchmark model. As shown in Table5, during the training and testing period, the DE stock selection model used in this paper is superior in average return AR and SharpeRatio, which not only shows that DE algorithm can better assist stock selection decision-making but also shows that the algorithm can achieve the best performance. The optimized factor weights have stronger generalization ability than the benchmark model. In order to statistically prove that the stock selection model adopted is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Secondly, construct a null hypothesis, H0: the AR of the stock selection model using DE is significantly lower than other benchmark models. As shown in the module, all models passed the normality test, and the values of all models were less than 5%. It shows that under the 95% confidence level, the DE-based stock selection model is better than other benchmark models. Thus, it is statistically proved that the differential evolution algorithm can better assist the stock selection decision-making.Table 5
Comparison results of different optimization algorithms in the stock selection model.
ModelTraining setTest sett-test H0:ARDF≤ARBenchmarkARSharpRatioARSharpRatioNormality test (p value)t-statp valueDE0.12010.13110.10780.36440.2988NANAPSO0.18870.10880.12440.35770.49993.79940.0002GA0.10010.10220.10120.35780.19944.3829<0.0001


### 4.2.4. Comparison of Different Fitness Functions (M4)

In this paper, the Spread fitness function (old standard han number) is used to make stock selection decisions, and four different fitness functions such as IC, CR, IFHR, and WIN are now used as benchmark models. The results are shown in Table6. The stock selection model using the Spread fitness function has outstanding performance in average return AR and Sharpe Ratio. The stock selection model using the Spread fitness function can better assist stock selection decisions. In order to statistically prove that the stock selection model using Spread is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: First, the Han-state test is performed on each model, and the normality test is the prerequisite for the test. Second, construct a null hypothesis, H0: the average return AR of Spread’s stock selection model is significantly lower than other benchmark models. According to the module, all models pass the normality test, and the values of all models are less than 5%. This shows that at the 95% confidence level, the stock selection model based on Spread is better than other benchmark models. Thus, it is statistically proved that the stock selection model using the Spread fitness function can better assist stock selection decision-making.Table 6
The comparison result of the fitness function in the stock selection model is the difference.
ModelSpreadICCRIFHRWINModule A: model performanceAR0.11090.08120.08990.11350.0898SharpeRatio0.37890.29780.35760.34770.3396Module: inspectionH0:ARSprear≤ARBenchmarkNormality test (p value)0.29970.38890.12990.37510.4999t-statNA18.443619.13243.11627.1124p valueNA<0.0001<0.00010.0013<0.0001


## 4.2.1. Comparison of Different Prediction Models (M1)

When constructing predictors, this article uses the extreme learning machine ELM to predict stock prices. In order to prove the effectiveness of ELM in stock forecasting, two classic forecasting methods, BP neural network (BPNN) and support vector machine regression (SVR), are introduced as benchmark models. Table3 shows the prediction results. Among them, Prob.(R1) is the probability that the stock selection model of this article will have a higher quarterly return than the quarterly earnings of R1; Prob.(R2) is the probability that the quarterly earnings of the stock selection model of this article will be higher than the quarterly earnings of R2; and Max. is the average value of the maximum return of the stock selection model of this article; Min. is the average value of the minimum return of the stock selection model of this article; and HitRate represents the probability of the model obtaining a positive return [20].Table 3
Comparison results of different forecasting methods in the stock selection model.
ModelELMBPNNSVRModule A: performance of stock-picking modelAR0.09980.08770.0799SharpeRatio0.40540.29970.3049Max.0.41990.40890.4278Min.−0.3178−0.3203−0.3049Prob.(R1)0.65540.47120.5083Prob.(R2)0.78310.75000.7521HitRatio0.76030.75800.5813Module B: t testH0:ARELM≤ARBenchmarkPositive test (p value)0.31210.20140.4179t-statNA18.143313.2240p valueNA<0.0001<0.0001Module C: stock forecastComputing time60.122216,100.254132,399.8999D-STAT0.51480.49970.4978MAPE0.21890.25780.4001RMSE18.999732.235944.8972Module D: DM test (H0: the prediction result based on the benchmark model is better than the prediction result based on ELM)DM-STATNA−17.2012−5.001p valueNA<0.0001<0.0001As shown in module A in Table3, the stock selection model using ELM performs more prominently in AR, SharpeRatio, Prob.(R1), Prob.(R2), and HitRatio. At the same time, the SVR stock selection model has achieved a little advantage in Max. and Min. while the stock selection model of BPNN is at a disadvantage in any evaluation index. This shows that the predictive factors constructed by ELM can better assist stock selection decisions. In order to statistically prove that the stock selection model using ELM is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Second, construct a null hypothesis, H0: the AR of the stock selection model using ELM is significantly lower than other benchmark models. According to module B, all models pass the normality test, and the values of all models are less than 5%. It shows that at the 95% confidence level, the stock selection model based on ELM is better than the benchmark model. This proves that the predictive factors constructed by ELM can better assist stock selection decision-making.Module C shows the evaluation indicators of all forecasting methods. Obviously, the method of using ELM to predict stock prices crushes all benchmark models in computing time, directional accuracy D-STAT, prediction accuracy MAPE, and RMSE. In the research of this article, ELM has more prominent predictive abilities. Similarly, in order to statistically prove that the prediction results based on the extreme learning machine ELM are significantly better than other benchmark models, this section conducts the Diebold–Mariano test (DM test) on each benchmark model. The process is as follows: construct a null hypothesis, H0: the prediction result based on ELM is significantly lower than the prediction result based on the benchmark model. The DM test results are shown in module D in Table3. All values are less than 5%, indicating that the prediction results based on ELM are better than the benchmark model at the 95% confidence level. This proves that ELM has a stronger predictive ability. It can be seen that the predictor based on ELM structure can better assist stock selection decision-making.


## 4.2.2. Comparison of Different Factorial Designs (M3)

The innovation of the stock selection model proposed in this paper is the use of predictive factors and financial factors to evaluate the value of stocks. The predictive factors contain the future information of the stock market, and the basic factors contain historical information of the stock. In order to prove the effectiveness of this innovative design, the proposed stock selection model A0 is compared with the benchmark model A1 and the benchmark model A2 (as shown in Table4). Among them, the benchmark model A1 only uses basic factors, similar to the traditional stock selection model, for which refer to the research done by Huang, and the benchmark model A2 only uses predictive factors, for which refer to the research done by Huang and Quah.Table 4
Comparison results of different factorial designs in the stock selection model.
ModelA0A1A2R1R2Module A: model performanceAR0.11020.07650.07990.84030.0398SharpeRatio0.40100.29970.30120.29880.1798Max.0.45870.40990.40100.37890.3594Min.−0.2998−0.3201−0.3587−0.3099−0.3178Prob.(R1)0.65490.43780.5001NA0.0000Prob.(R2)0.80010.76030.75541.0000NAHitRatio0.76020.78120.73990.78490.5645Module B: t-testH0:ARDF≤ARBenchmarkNormality test (p value)0.29980.04890.3379NANAt statNA20.587914.133925.899957.0004p valueNA<0.0001<0.0001<0.0001<0.0001Table4 shows the relevant results. At the same time, the A0 stock selection model has achieved outstanding performance in AR, SharpeRatio, Min., and Prob.(R1). However, only the A1 stock selection model and the A2 stock selection model have no outstanding performance in the various evaluation indicators. In order to statistically prove that the stock selection model using A0 is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Secondly, construct a null hypothesis, H0: the average return AR of the stock selection model A0 using predictive factors and financial factors is significantly lower than other benchmark models. According to module B, all models pass the normality test, and the values of all models are less than 5%. It shows that under the 95% confidence level, the stock selection model A0 using predictive factors and financial factors is better than other benchmark models. This proves that adding predictive factors can better assist stock selection decisions, and financial factors are equally important.


## 4.2.3. Comparison of Different Optimization Algorithms (M3)

In this paper, the differential evolution algorithm is used to optimize the weights of various factors. In order to prove the effectiveness of DE, the classic genetic algorithm GA and particle swarm algorithm PSO are set as the benchmark model. As shown in Table5, during the training and testing period, the DE stock selection model used in this paper is superior in average return AR and SharpeRatio, which not only shows that DE algorithm can better assist stock selection decision-making but also shows that the algorithm can achieve the best performance. The optimized factor weights have stronger generalization ability than the benchmark model. In order to statistically prove that the stock selection model adopted is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: first, the normality test is performed on each model, and the normality test is the prerequisite for the test. Secondly, construct a null hypothesis, H0: the AR of the stock selection model using DE is significantly lower than other benchmark models. As shown in the module, all models passed the normality test, and the values of all models were less than 5%. It shows that under the 95% confidence level, the DE-based stock selection model is better than other benchmark models. Thus, it is statistically proved that the differential evolution algorithm can better assist the stock selection decision-making.Table 5
Comparison results of different optimization algorithms in the stock selection model.
ModelTraining setTest sett-test H0:ARDF≤ARBenchmarkARSharpRatioARSharpRatioNormality test (p value)t-statp valueDE0.12010.13110.10780.36440.2988NANAPSO0.18870.10880.12440.35770.49993.79940.0002GA0.10010.10220.10120.35780.19944.3829<0.0001


## 4.2.4. Comparison of Different Fitness Functions (M4)

In this paper, the Spread fitness function (old standard han number) is used to make stock selection decisions, and four different fitness functions such as IC, CR, IFHR, and WIN are now used as benchmark models. The results are shown in Table6. The stock selection model using the Spread fitness function has outstanding performance in average return AR and Sharpe Ratio. The stock selection model using the Spread fitness function can better assist stock selection decisions. In order to statistically prove that the stock selection model using Spread is significantly better than other benchmark models, this section tests each benchmark model. The process is as follows: First, the Han-state test is performed on each model, and the normality test is the prerequisite for the test. Second, construct a null hypothesis, H0: the average return AR of Spread’s stock selection model is significantly lower than other benchmark models. According to the module, all models pass the normality test, and the values of all models are less than 5%. This shows that at the 95% confidence level, the stock selection model based on Spread is better than other benchmark models. Thus, it is statistically proved that the stock selection model using the Spread fitness function can better assist stock selection decision-making.Table 6
The comparison result of the fitness function in the stock selection model is the difference.
ModelSpreadICCRIFHRWINModule A: model performanceAR0.11090.08120.08990.11350.0898SharpeRatio0.37890.29780.35760.34770.3396Module: inspectionH0:ARSprear≤ARBenchmarkNormality test (p value)0.29970.38890.12990.37510.4999t-statNA18.443619.13243.11627.1124p valueNA<0.0001<0.00010.0013<0.0001


## 5. Conclusion

This paper uses two machine learning models, neural network and support vector machine, to predict stock prices and conduct empirical research on China’s A-share market. The results show that the machine learning model adopted in this paper has obvious advantages in terms of ROI and model robustness. The returns of portfolios constructed using the stock selection model proposed in this paper are much higher than the average market performance (i.e., an equal-weighted portfolio of all stocks) and the China A-share index. Notably, in model optimization, predictors were given higher weights, suggesting that stock predictors play an important role in stock selection. This also supports the new idea that introducing stock predictors can improve stock selection decisions. Especially when comparing the designs of different factors, the stock selection model proposed in this paper has a significant advantage over the benchmark model A1 (considering only financial factors) and the benchmark model A2 (considering only predictive factors). This paper provides empirical experience and model design guidance for using machine learning for stock selection.



---

*Source: 9613554-2022-03-24.xml*