=Paper= {{Paper |id=Vol-2540/paper33 |storemode=property |title=None |pdfUrl=https://ceur-ws.org/Vol-2540/FAIR2019_paper_45.pdf |volume=Vol-2540 }} ==None== https://ceur-ws.org/Vol-2540/FAIR2019_paper_45.pdf
    Automatic construction of neural networks for
          stock market trend prediction

                   Kouame Kouassi1 and Deshendran Moodley2
1
    University of Cape Town - Centre for Artificial Intelligence Research, South Africa
                              ksskou001@myuct.ac.za
       2
         University of Cape Town - Centre for Artificial Research, South Africa
                               deshen@cs.uct.ac.za



        Abstract. Although significant work has been done for hyperparame-
        ter optimisation (HO) for deep learning structures in general, there is
        limited research exploring their use for time series applications, such as
        stock market prediction. In this research we evaluate the potential for
        automating structure learning and hyperparameter selection for neural
        networks for stock market trend prediction with a limited computational
        budget. We evaluate Bayesian Optimisation and Hyperband (BOHB), for
        automatic construction of LSTM and CNN models, and compare these
        to manually tuned models. The results show that the BOHB technique
        can select CNN and LSTM models that can compete against manually
        tuned models.

        Keywords: Stock Market · Trend Prediction · Automated Hyperpa-
        rameter Optimisation · Neural Networks.


1     Stock trend prediction problem, and hyperparameter
      optimisation
Given a stock market index such as S&P 500, we aim to classify the next day
trend direction (UP or DOWN) using the last l days price sequence. Wen et
al. [6] recently tackled it using a convolutional neural networks (CNN) based
approach whereas Guo and Li [3] proposed a long-short term memory (LSTM)
recurrent neural networks approach.
    The hyperparameter optimisation problem is about finding the optimal hy-
perparameter configuration that minimises the loss function of a learning algo-
rithm over its hyperparameter space when trained on a training dataset and
evaluated on the corresponding evaluation set.


2     Experimental Design
To evaluate the effectiveness of BOHB [2], we compared the performance of the
hyperparameters found with BOHB against manually tuned baselines. The base-
lines consists of a manually tuned CNN and a manually tuned LSTM using S&P
500 dataset, and Wen et al. [6], and Guo and Li’s [3] results, where applicable.


Copyright © 2019 for this paper by its authors. Use permitted under Creative Commons License
Attribution 4.0 International (CC BY 4.0)
2        K. Kouassi and D. Moodley

    We used the the daily stock closing price of the S&P 500, JSE Limited (JSE),
NASDAQ and Dow Jones 30 (DOW 30), with lag l = 10, and stride s = 1. We
used 70% of the dataset for training, 15%, for validation and 15% for testing.
Similar to Wen et al. [6], and Guo and Li [3], we used accuracy, and f1-score
(f1) as generalisation metrics. We used HyperbandSter3 [2] with the number of
epochs as budget where the minimum budget was 3 epochs and the maximum
budget 30 epochs. We set η to 3 and used 30 iterations. This is equivalent 80
full evaluations. Each experiment was run 10 times.


3     Results and Discussions
The performance on the 8 individual datasets are shown in table 1.


      Table 1. Comparison of BOHB (A) with the manually tuned baselines (M)

           S&P 500     NASDAQ      DOW 30           JSE               SH               SZ         CSI 300     SSE 50
Method
          acc.   f1    acc.   f1   acc.   f1   acc.       f1   acc.        f1   acc.        f1   acc.   f1   acc.   f1
A-CNN    53.26 67.66 54.30 63.46 53.33 68.80 89.33 94.35 47.88 50.46 52.40 42.34 49.33 41.45 51.15 36.45
M-CNN    53.73 67.95 54.74 69.26 53.68 68.00 83.86 90.93 48.72 43.94 55.45 21.33 57.05 31.01 47.44 47.27
A-LSTM 53.53 68.26 55.56 71.04 52.90 67.53 88.89 94.11 48.27 52.53 47.98 49.83 49.62 52.91 50.67 53.46
M-LSTM 53.73 69.74 55.56 71.25 53.83 69.83 90.44 94.95 45.19 61.74 39.74 56.88 41.67 58.45 49.04 65.66
Wen      56.14 63.67    -     -     -     -     -         -      -         -     -          -     -     -     -     -
Guo        -     -      -     -     -     -     -         -    55.89 42.99 64.13 37.49 67.25 46.51 59.52 43.99




    On the individual datasets, A-CNN improved on 7 metrics over M-CNN,
under-performed on 9; whereas, A-LSTM out-performed M-LSTM on 4 metrics,
and under-performed on 11. For NASDAQ, A-LSTM matched the accuracy of
the manual LSTM. Compared to the results found in the literature by Wen. et
al [6] and Guo and Li [3], our methods under-performed on accuracy but out-
performed on f1-score. On average, A-CNN improved on M-CNN’s and f1-score
by 5.75% (54.96 ± 23.06 to 58.12 ± 19.28); but, decreased on accuracy by 0.81%
(56.83 ± 11.40 to 56.37 ± 13.49 ). A-LSTM on the other hand, could not match
M-LSTM on f1-score with a performance drop of 7.07% (68.56 ± 11.95 versus
63.71 ± 14.89). However, it beat M-LSTM on accuracy by 4.74% (53.40 ± 16.24
versus 55.93 ± 13.58).


4     Conclusions
We evaluated the potential for automatic construction of CNN and LSTM for
stock market trend prediction in a resource constrained setting. Our results
showed that BOHB can compete favourably with manual HO.
1
  https://finance.yahoo.com/
2
  https://www.investing.com/
3
  https://github.com/automl/HpBandSter
                                           AutoNNs for stock trend prediction         3

References
1. Bergstra,     J.,    Bengio,    Y.:    Random      search    for    hyper-parameter
   optimization.     J.   Mach.     Learn.     Res.   13,    281–305      (Feb    2012),
   http://dl.acm.org/citation.cfm?id=2188385.2188395
2. Falkner, S., Klein, A., Hutter, F.: BOHB: Robust and Efficient Hyperparameter
   Optimization at Scale (2018), http://arxiv.org/abs/1807.01774
3. Guo, J., Li, X.: Prediction of index trend based on lstm model for extract-
   ing image similarity feature. In: Proceedings of the 2019 International Confer-
   ence on Artificial Intelligence and Computer Science. pp. 335–340. AICS 2019,
   ACM, New York, NY, USA (2019). https://doi.org/10.1145/3349341.3349427,
   http://doi.acm.org/10.1145/3349341.3349427
4. Li, L., Jamieson, K., DeSalvo, G., Rostamizadeh, A., Talwalkar, A., Berkeley, U.:
   HYPERBAND: BANDIT-BASED CONFIGURATION EVAL-UATION FOR HY-
   PERPARAMETER OPTIMIZATION. In: International Conference on Learning
   Representations (2017), https://github.com/automl/RoBO.
5. Shahriari, B., Swersky, K., Wang, Z., Adams, R.P., de Freitas, N.: Taking the Human
   Out of the Loop: A Review of Bayesian Optimization. Proceedings of the IEEE
   104(1), 148–175 (jan 2016). https://doi.org/10.1109/JPROC.2015.2494218
6. Wen, M., Li, P., Zhang, L., Chen, Y.: Stock Market Trend Pre-
   diction Using High-Order Information of Time Series. IEEE Access
   7,     28299–28308      (2019).     https://doi.org/10.1109/ACCESS.2019.2901842,
   https://ieeexplore.ieee.org/document/8653278/
7. Young, S.R., Rose, D.C., Karnowski, T.P., Lim, S.H., Patton, R.M.: Op-
   timizing deep learning hyper-parameters through an evolutionary algo-
   rithm. In: Proceedings of the Workshop on Machine Learning in High-
   Performance Computing Environments. pp. 4:1–4:5. MLHPC ’15, ACM,
   New York, NY, USA (2015). https://doi.org/10.1145/2834892.2834896,
   http://doi.acm.org/10.1145/2834892.2834896