Applications of deep learning in stock market prediction: recent progress — part 3/5

Cleaned-text code points [30831, 46792). Bibliography omitted here; source.md includes it.

Given different input features with varying scales, feature normalization and standardization are used to guarantee that some machine learning models can work and also help to improve the model’s training speed and performance. Feature normalization refers to the process of rescaling the input feature by the minimum and range, to make all the values lie between 0 and 1 [ Wang & Wang, 2015 , Gunduz et al., 2017 , Li et al., 2017b , Singh & Srivastava, 2017 , Althelaya et al., 2018 , Althelaya et al., 2018 , Baek & Kim, 2018 , Chen et al., 2018a , Chung & Shin, 2018 , Gao & Chai, 2018 , Hossain et al., 2018 , Hu et al., 2018a , Lien Minh et al., 2018 , Pang et al., 2018 , Tang & Chen, 2018 , Tsang et al., 2018 , Yang et al., 2018 , Zhan et al., 2018 , Al-Thelaya et al., 2019 , de A. Araújo et al., 2019 , Cao et al., 2019 , Cao & Wang, 2019 , Ding & Qin, 2019 , Lee et al., 2019 , Li et al., 2019b , Sachdeva et al., 2019 , Sethia & Raut, 2019 , Tang et al., 2019 ] , or between -1 and 1 [ Ticknor, 2013 , Zhang et al., 2017b , Sezer & Ozbayoglu, 2018 ] . Feature standardization means subtracting a measure of location and dividing by a measure of scale, e.g., the z-score method that subtracts the mean and divides by the standard deviation [ Tsantekidis et al., 2017a , Tsantekidis et al., 2017b , Zhang et al., 2019b , Li et al., 2019a ] .

#### 4.2.6 Data Split

For evaluation of different prediction models, in-sample/out-of-sample split or train/validation/test split of data samples is commonly used in machine learning and deep learning fields. The model is trained with the training or in-sample data set, the hyper-parameters is fine-tuned on the validation data set optional, and the final performance is evaluated on the test or out-of-sample data set. k-fold cross validation is further used to split the dataset into k consecutive folds, and k-1 folds is used as the training set, while the last fold is then used as a test set.

As a special case, train-validation-test split with a rolling (or sliding, moving, walk-forward) window is also often used for time series tasks including stock prediction [ Bao et al., 2017 , Nelson et al., 2017 , Fischer & Krauss, 2018 , Gao & Chai, 2018 , Zhou et al., 2018 , Nguyen & Yoon, 2019 , Kim et al., 2019 , Sun et al., 2019 , Wang et al., 2019a ] . The process of a rolling train-validation-test split is shown in Figure 6 , where only the latest part of data samples are used for a new training round of prediction models. Another variant is to use successive training sets, which are union set of the rolling training set that come before them, as shown in Figure 6 .

#### 4.2.7 Data Augmentation

Data augmentation techniques have been widely used for image classification and object detection tasks and proved to effectively enhance the classification and detection performance. However, it is less used for time series tasks including stock prediction, even though the size of stock price time series is not comparable to the size of public image datasets, which usually have millions of sample and even more in recent years.

There are still a few works that explore the usage of data augmentation. Zhang et al. [2017a] firstly clusters different stocks based on their retracement probability density function and combines all the day-wise information of the same stock cluster as enlarged training data. In the ModAugNet framework proposed in Baek & Kim [2018] , the authors choose 10 companies’ stock that are highly correlated to the stock index and augment the data samples by using the combinations of 10 companies taken 5 at a time in an overfitting prevention LSTM module, before feeding the data samples to a prediction LSTM module for stock market index prediction.

### 4.3 Prediction Model

Most of the prediction models belong to a supervised learning approach, when training set is used for the training and test set is used for evaluation. Only a few of the studies use semi-supervised learning when the labels are not available in the feature extraction step. We further classify the various prediction models into three types: standard models and their variants, hybrid models, and other models. For standard models, three families of deep learning models, namely, feedforward neural network, convolutional neural network and recurrent neural network, are used a lot. And we category the use of generative adversarial network, transfer learning, and reinforcement learning into other models. These models only appear in recent years and are still in an early stage of being applied for stock market prediction.

In this part, we are focusing on the usage of different types of deep learning models, instead of diving into the details of each model. For a more detailed introduction to deep learning models, we refer the readers to Goodfellow et al. [2016] . The abbreviations of machine learning and deep learning methods are shown in Table 5 .

Some of the earlier work use ANNs as their prediction models and study the effect of different combinations of input features [ Niaki & Hoseinzade, 2013 , de Oliveira et al., 2013 , Zhong & Enke, 2017 ] . In this survey, we use ANN to refer to the neural networks which only have one or zero hidden layers, and DNN to refer to those which have two or more hidden layers. The list of standard models or their variants is shown in Table 6 . We organize the standard models into three major types:

1. Feedforward neural network (FFNN) . It is the simplest type of artificial neural network wherein connections between the nodes do not form a cycle. An artificial neural networks (ANN) are learning models inspired by biological neural networks, and the neuron in an ANN consists of an aggregation function which calculates the sum of the inputs, and an activation function which generates the outputs. An autoencoder (AE) is a subset of ANN which has the same number of nodes in the input and output layers. When ANN has two or more hidden layers, we denote it as deep neural network (DNN) is this survey. We also category the following models into this family because they share a similar structure: backpropagation neural network (BPNN), multilayer perceptron (MLP), extreme learning machines (ELM) where the parameters of hidden nodes need not be tuned, deep increasing–decreasing-linear neural network (IDLNN) where each layer is composed of a set of increasing–decreasing-linear processing units [ de A. Araújo et al., 2019 ] , stochastic time effective function neural network (STEFNN) [ Wang & Wang, 2015 ] , radial basis function network (RBFN) that uses radial basis functions as activation functions.

2. Convolutional neural network (CNN) . Designed for processing two-dimensional images, each group of neurons, which is also called a filter, performs a convolution operation to a different region of the input image and the neurons share the same weights, which reduces the number of parameters compared to the densely connected feedforward neural network. Pooling operations, e.g. , max pooling, are used to reduce the original size and can be used for multiple times, until the final output is concatenated to a dense layer. Powered by the parallel processing ability of graphics processing unit (GPU), the training of CNN has been shortened and CNN has achieved an astonishing performance for image related tasks and competitions. By reducing the convolutional and pooling operations to a single temporal dimension, 1D CNN is proposed for time series classification and prediction, e.g., Deng et al. [2019] uses a 1-D fully-convolutional network (FCN) architecture, where each hidden layer has the same length as the input layer, and zero padding is added to keep subsequent layers the same length as previous ones.

3. Recurrent neural network (RNN) . Compared with feedforward neural network, recurrent neural network is an artificial neural network wherein connections between the nodes form a cycle along a temporal sequence, which helps it to exhibit temporal dynamic behavior. However, normal RNNs are bothered by the vanishing gradient problem in practice, when the gradients of some of the weights start to shrink or enlarge if the network is unfolded too many times. Long short-term memory (LSTM) networks are RNNs that solve the vanishing gradient problem, where the hidden layer is replaced by recurrent gates called forget gates. Gated recurrent unit (GRU) is another RNN that uses forget gates, but has fewer parameters than LSTM. Bi-directional RNN are RNNs that connect two hidden layers of opposite directions to the same output. Both bi-directional LSTM (BiLSTM) and bi-directional GRU (BGRU) have been used for stock market prediction.

While standard models perform well at early stages of research, their variants are further developed to improve the prediction performance. One approach is to use stacked models, where neural network sub-models are embedded in a larger stacking ensemble model for training and prediction. Another approach is to introduce the attention mechanism [ Treisman & Gelade, 1980 ] into recurrent neural network models, in which attention is a generalized pooling method with bias alignment over inputs.

There are also some types that we list separately: 1. Restricted Boltzmann machine (RBM) is a generative stochastic artificial neural network that can learn a probability distribution over its set of inputs. And a deep belief network (DBN) can be defined as a stack of RBMs. DBNs have been used in Li et al. [2017b] , Karathanasopoulos & Osman [2019] for stock prediction.

2. Sequence to sequence (seq2seq) model is based on the encoder-decoder architecture to generate a sequence output for a sequence input, in which both the encoder and the decoder use recurrent neural networks. Seq2seq model has been used in Liu & Wang [2019] for stock prediction.

While our focus in this survey is not the linear models or the traditional machine learning models, they are often used as baselines for comparison with deep learning models.

Some often used linear prediction models are as follows: 1. Linear regression (LR) . Linear regression is a classical linear model that tries to fit the relationship between the predicted target and the input variables with a linear model, in which the parameters can be learned in the least squares approach.

2. Autoregressive integrated moving average (ARIMA). ARIMA is a generalization of the autoregressive moving average (ARMA) model, which describes a weakly stationary stochastic process with two parts, namely, the autoregression (AR) and the moving average (MA). Compared with ARMA, ARIMA is capable of dealing with non-stationary time series, by introducing an initial differencing step, which is referred as the integrated part in the model.

3. Generalized autoregressive conditional heteroskedasticity (GARCH). GARCH is also a generation of the autoregressive conditional heteroscedasticity (ARCH) model, which describes the error variance as a function of the actual sizes of the previous time periods’ error terms. Instead of using AR model in ARCH, GARCH assumes an ARMA model for the error variance, which generalizes ARCH.

Similarly, some often used machine learning models are as follows: 1. Logistics regression (Logit) . Logistics regression can be seen as a generalized linear model, in which a logistic function is used to model the probabilities of a binary target of being 0 or 1. It is suitable for the classification of price movements, e.g., going up or down.

2. Support vector machine/regression (SVM/SVR) . Support vector machine is a classical and powerful tool for classification with a good theoretical performance guarantee and has been widely adopted before the popularity of deep learning models. SVM tries to learn a hyperplane to distinguish the training samples that maximize distance of the decision boundary from training samples. Combine with the kernel trick, which maps the input training samples into high-dimensional feature spaces, SVM can efficiently perform non-linear classification tasks. Support vector regression is the regression version of SVM.

3. k-nearest neighbor (kNN) . kNN is a non-parametric model for both classification and regression, in which the output is the class most common or the average of the values among k k nearest neighbors. A useful technique is to assign weights to the neighbors when combing their contributions.

Given the predicted movement direction or prices, a long-short strategy can be further designed to perform trading based on the prediction model, e.g., if the predicted direction is going up, long it, otherwise short it. A simple baseline is the Buy&Hold Strategy, which buys the asset at the beginning and hold it to the end of the testing period, without any further buying or selling operations [ Niaki & Hoseinzade, 2013 , Sezer & Ozbayoglu, 2018 ] .

Technical indicators are also often used for designing baseline trading strategies, e.g., momentum strategy, which is introduced in Jegadeesh & Titman [1993] , is a simple strategy of buying winners and selling losers. MACD [ Appel & Dobson, 2007 ] consists of the MACD line and the signal line, and the most common MACD strategy buys the stock when the MACD line crosses above the signal line and sells the stock when the MACD line crosses below the signal line [ Lee et al., 2019 ] . In our surveyed papers, RSI (14 days, 70-30) and SMA (50 days) are used to design baseline trading strategies [ Sezer & Ozbayoglu, 2018 ] .

We further categories the hybrids into two classes, namely, the hybrid models between deep learning models and traditional models, and the hybrid models between different deep learning models.

The list of hybrid models between deep learning models and traditional models is shown in Table 7 . Li et al. [2019b] formulates a sentiment-ARMA model to incorporate the news articles as hidden information and designs a LSTM-based DNN, which consists of three components, namely, LSTM, VADER model and differential privacy mechanism that integrates different news sources. To deal with strong noise, Liu & Song [2017] uses weak ANNs to get some information without over-fitting and get better results by combining the weak results together using optimized bagging. Wu & Gao [2018] uses AdaBoost algorithm to generate both training samples and ensemble weights for each LSTM predictor and the final prediction results are the combination of all the LSTM predictors with ensemble weights.

The list of hybrid models between different deep learning models is shown in Table 8 . Two popular combinations are the combination of CNN and RNN structures and the combination of different RNNs.

For the former case, TreNet [ Lin et al., 2017 ] hybrids LSTM and CNN for stock trend classification. Zhang et al. [2019b] proposes a deep learning model, comprising three main building blocks that include a standard convolutional layer, an Inception Module and a LSTM layer. Guang et al. [2019] uses convolutional units to extract multi-scale features that precisely describe the state of the financial market and capture temporal, and uses a recurrent neural network to capture the temporal dependency and complementary across different scales.

For the latter case, Al-Thelaya et al. [2019] proposes a forecasting model, using a combination of LSTM autoencoder and stacked LSTM network. Wang et al. [2019a] proposes a hybrid model, consisting of stochastic recurrent networks, the sequence-to-sequence architecture, the self- and inter-attention mechanism, and convolutional LSTM units. Liu & Chen [2019] proposes an elective Recurrent Neural Networks with Random Connectivity Gated Unit (SRCGUs) that train random connectivity LSTMs, GRUs and MGUs simultaneously.

We list other types of models in Table 9 . We category five types of models in this part, which have not been fully explored for stock market prediction but already show some promising results.