seen in previous experiments, when predicting
APPLES' stock data, the CNN model took only
7.97 seconds, but the LSTM model took 92.87
seconds.
(2) The CNN-LSTM model has an excellent fit. It
not only solves the defect of lagging prediction
results of LSTM model, but also obtains
extremely high efficiency. As can be seen from
the runtime result data in the chart, the CNN-
LSTM model took only 7.91 seconds to process
APPLE's stock data. The CNN-LSTM model
does not perform very well when predicting
small stock data. From the prediction curve, the
curve fitting is not very good and there is a
significant error. Although the CNN-LSTM
model can still achieve short time consumption
and no lag when predicting small stock data, the
prediction error is relatively large and the curve
is not fitted very well. Through the analysis, this
paper finds that since the CNN-LSTM model
extracts features from the convolutional layer in
the CNN model and then uses the features as
inputs to the LSTM layer, this can easily lead to
the output of the CNN that may lose some
important information of the original data that is
important for the LSTM, and this can lead to a
degradation of the fusion model's performance.
(3) From the results, CNN model has better
accuracy, stability and short time consuming
when predicting stock prices. CNN-LSTM
model performs well when dealing with large
stock data, not only efficient but also accurate.
However, when dealing with small stock data, it
can lead to poor fitting due to too little feature
data. Thus, in this paper, CNN-LSTM model is
considered to be poor in stability. LSTM model
will show deviation between the predicted curve
and the real curve when predicting the stock
price, and high time consuming is also its defect.
Nevertheless, this paper does not consider the
LSTM model and CNN-LSTM model as
unsuitable for predicting stock prices compared
to the CNN model because in machine learning
and financial forecasting, simply performing
well on a training set is not enough to show that
the model works just as well in real-world
applications. When predict the stock data, both
LSTM and CNN-LSTM models consider the
effect of feature values on the target value (stock
closing price) and are accompanied by long term
memory, so the predict results of them have
more real-world applications value, while CNN
models do not have these properties. Therefore,
in this paper, we believe that the prediction
results of LSTM and CNN-LSTM models have
the higher reference value for investors
.
4 CONCLUSION
Stock price prediction is a multifaceted and intricate
endeavor influenced by a myriad of factors. While
both CNN and LSTM models have demonstrated
efficacy in this domain, each exhibits inherent
limitations. To address this challenge, this study
introduces a novel stock price prediction
methodology leveraging a hybrid CNN-LSTM
model. By amalgamating the feature extraction
prowess of CNN with LSTM's adeptness in sequence
data processing, the resultant model achieves
heightened accuracy and enhanced stability. In the
experimental setup, we initially curate two distinct
stock datasets varying significantly in size,
accompanied by four evaluation metrics.
Subsequently, standalone CNN and LSTM models
are trained and evaluated on these datasets
individually. Prediction outcomes are obtained and
corresponding evaluation indices computed.
Thereafter, the hybrid CNN-LSTM model is
formulated, trained on the same datasets, and
evaluated using the established metrics. Comparative
analysis of the prediction outcomes across the three
models and the four evaluation metrics ensues.
The analysis shows that the CNN model exhibits
short time-consumption, stability, and accuracy when
dealing with both large and small stock data. The
LSTM model, on the other hand, possesses the
drawbacks of long time-consumption and the
generation of deviations between the prediction
curves and the true-value curves. The CNN-LSTM
model solves the two problems existing in the LSTM
model, however, since the features extracted by the
CNN model lose some important information about
the original data, this makes the data processed by the
LSTM layer incomplete, and this can lead to a
degradation in the performance of the fusion model.
Although both the LSTM model and CNN-LSTM
model are not as suitable as the CNN model for stock
price prediction in terms of the results, their
prediction results have higher practical application
value because they put the feature values into the
model to join the training and introduce the memory
gate and forgetting gate.
Finally, this paper argues that the CNN-LSTM
fusion model is suitable for predicting large stock
data because this model is characterized by high
efficiency, accuracy, and realistic applications. For
investors, this paper holds that both CNN model and