<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Automatic construction of neural networks for stock market trend prediction</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Kouame Kouassi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Deshendran Moodley</string-name>
          <email>deshen@cs.uct.ac.za</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Cape Town - Centre for Arti cial Intelligence Research</institution>
          ,
          <country country="ZA">South Africa</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Cape Town - Centre for Arti cial Research</institution>
          ,
          <country country="ZA">South Africa</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Although signi cant work has been done for hyperparameter 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.</p>
      </abstract>
      <kwd-group>
        <kwd>Stock Market Trend Prediction rameter Optimisation Neural Networks</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Stock trend prediction problem, and hyperparameter
optimisation
Given a stock market index such as S&amp;P 500, we aim to classify the next day
trend direction (UP or DOWN) using the last l days price sequence. Wen et
al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] recently tackled it using a convolutional neural networks (CNN) based
approach whereas Guo and Li [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] proposed a long-short term memory (LSTM)
recurrent neural networks approach.
      </p>
      <p>
        The hyperparameter optimisation problem is about nding the optimal
hyperparameter con guration that minimises the loss function of a learning
algorithm over its hyperparameter space when trained on a training dataset and
evaluated on the corresponding evaluation set.
To evaluate the e ectiveness of BOHB [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], we compared the performance of the
hyperparameters found with BOHB against manually tuned baselines. The
baselines consists of a manually tuned CNN and a manually tuned LSTM using S&amp;P
500 dataset, and Wen et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and Guo and Li's [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] results, where applicable.
      </p>
      <p>K. Kouassi and D. Moodley</p>
      <p>
        We used the the daily stock closing price of the S&amp;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. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and Guo and Li [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], we used accuracy, and f1-score
(f1) as generalisation metrics. We used HyperbandSter3 [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] 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
      </p>
    </sec>
    <sec id="sec-2">
      <title>Results and Discussions</title>
      <p>The performance on the 8 individual datasets are shown in table 1.</p>
      <p>
        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 [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and Guo and Li [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], our methods under-performed on accuracy but
outperformed 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
      </p>
    </sec>
    <sec id="sec-3">
      <title>Conclusions</title>
      <p>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:// nance.yahoo.com/
2 https://www.investing.com/
3 https://github.com/automl/HpBandSter</p>
      <p>AutoNNs for stock trend prediction</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bergstra</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bengio</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Random search for hyper-parameter optimization</article-title>
          .
          <source>J. Mach. Learn. Res</source>
          .
          <volume>13</volume>
          ,
          <issue>281</issue>
          {305 (Feb
          <year>2012</year>
          ), http://dl.acm.org/citation.cfm?id=
          <volume>2188385</volume>
          .
          <fpage>2188395</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Falkner</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klein</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hutter</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>BOHB: Robust and</article-title>
          E cient Hyperparameter Optimization at Scale (
          <year>2018</year>
          ), http://arxiv.org/abs/
          <year>1807</year>
          .01774
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Guo</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>X.:</given-names>
          </string-name>
          <article-title>Prediction of index trend based on lstm model for extracting image similarity feature</article-title>
          .
          <source>In: Proceedings of the 2019 International Conference on Arti cial Intelligence and Computer Science</source>
          . pp.
          <volume>335</volume>
          {
          <fpage>340</fpage>
          .
          <source>AICS</source>
          <year>2019</year>
          , ACM, New York, NY, USA (
          <year>2019</year>
          ). https://doi.org/10.1145/3349341.3349427, http://doi.acm.
          <source>org/10</source>
          .1145/3349341.3349427
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jamieson</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>DeSalvo</surname>
          </string-name>
          , G.,
          <string-name>
            <surname>Rostamizadeh</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Talwalkar</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , Berkeley, U.:
          <article-title>HYPERBAND: BANDIT-BASED CONFIGURATION EVAL-UATION FOR HYPERPARAMETER OPTIMIZATION</article-title>
          . In: International Conference on Learning Representations (
          <year>2017</year>
          ), https://github.com/automl/RoBO.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Shahriari</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Swersky</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Adams</surname>
            ,
            <given-names>R.P.</given-names>
          </string-name>
          , de Freitas, N.:
          <article-title>Taking the Human Out of the Loop: A Review of Bayesian Optimization</article-title>
          .
          <source>Proceedings of the IEEE</source>
          <volume>104</volume>
          (
          <issue>1</issue>
          ),
          <volume>148</volume>
          {175 (jan
          <year>2016</year>
          ). https://doi.org/10.1109/JPROC.
          <year>2015</year>
          .2494218
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Wen</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Stock Market Trend Prediction Using High-Order Information of Time Series</article-title>
          .
          <source>IEEE Access 7</source>
          ,
          <issue>28299</issue>
          {
          <fpage>28308</fpage>
          (
          <year>2019</year>
          ). https://doi.org/10.1109/ACCESS.
          <year>2019</year>
          .
          <volume>2901842</volume>
          , https://ieeexplore.ieee.org/document/8653278/
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Young</surname>
            ,
            <given-names>S.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rose</surname>
            ,
            <given-names>D.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Karnowski</surname>
            ,
            <given-names>T.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lim</surname>
            ,
            <given-names>S.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patton</surname>
            ,
            <given-names>R.M.:</given-names>
          </string-name>
          <article-title>Optimizing deep learning hyper-parameters through an evolutionary algorithm</article-title>
          .
          <source>In: Proceedings of the Workshop on Machine Learning in HighPerformance Computing Environments</source>
          . pp.
          <volume>4</volume>
          :
          <issue>1</issue>
          {
          <issue>4</issue>
          :
          <fpage>5</fpage>
          . MLHPC '15,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          , New York, NY, USA (
          <year>2015</year>
          ). https://doi.org/10.1145/2834892.2834896, http://doi.acm.
          <source>org/10</source>
          .1145/2834892.2834896
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>