Inti Cerita

Side-kick; a close friend or follower who accompanies another on adventures, etc. a secondary character. Terlepas dari banyaknya makna “Side-kick” dari berbagai sudut pandang. Aku sebagai penulis…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




LSTMs or CNNs for predicting Stock Prices?

Should we abandon LSTMs for CNNs?

LSTMs have always been considered the go-to algorithm for sequential data, and CNNs have always been considered as the best algorithm for image data processing. But how much truth is in this sentiment? Many papers have been written, on the use of character-level CNNs that are on par with, or even better than LSTMs or other recurrent networks!

To test this hypothesis, I decided to implement both of these algorithms to a classic case of time-series analysis: stock price prediction.

To give a fair comparison of how the two different algorithms match up in an experiment, I must give context into how each of these algorithms works.

LSTMs are a type of recurrent neural network, that consists of many neural networks that each serve a function to the output of the algorithm. For example, there is a forget network that is trained to reduce the weightage of redundant signals.

This complex positioning of recurrent neural networks allows for the network to recall past “memories”(past data). This ability makes it easier to create connections between current data points and past data points, allowing the network to find patterns that play out over time.

CNNs were the first innovation from the multi-layer perceptron first perceived in the late 20th century. They consist of filters that are applied along the input data. This effectively condenses the data into a smaller resolution. The CNNs are trained to convert full-scale images into smaller resolutions without losing essential information. They are basically able to de-noise the input data, so that it can be fed through a basic neural network.

This spatial recognition can not only function in 2D spaces, it also applies in 3D spaces (videos that consist of images over time) and also 1D spaces, where the data is simply an array of values. This versatility is really what make CNNs so useful.

The LSTM and the CNN will be implemented on the AAPL data over the last 20 years. The evaluation will be evaluated based on the loss values of the program, as well as observing the…

Add a comment

Related posts:

SolFighters

The time of battling cute, furry, blobs with eyes is over. Do you want a real battle? Do you want to feel what victory can be like in more capable hands? SolFighters is here and there is an…

WSO2 IS Analytics for Risk based Adaptive Authentication

As I promised in my Cumulative Risk-Based Adaptive Authentication blog, here I will explain the role of the WSO2 IS Analytics when implementing a Risk based adaptive authentication usease. Through…

Books We Would Give to Our Younger Selves

Happy World Book Day to all! To storytellers, story lovers and seekers all over the world, this is quite an exciting day. We know the power of a good book. They have a way of capturing the mind and…