Inspiration

How accurately can AI technologies predict stocks? As someone who has always been interested in stock investments and finance, the rise of AI bots to help investors make decisions prompted me to look more closely into its great promises. I created this project to learn more about how neural networks can process data, while also aiming to see how accurate models could become. It turns out, AI is pretty dang good at predicting stock prices.

What it does

The project leverages a Long Short-Term Memory, or LSTM for short, model to predict Google's stock prices. LSTM is a type of recurrent neural network geared towards deep learning and sequence prediction. It does this by fetching historical stock data regarding the company, preprocessing it, and training the neural network to predict future prices. This can provide a potentially valuable tool for investors.

How we built it

This project was implemented in Python and developed in VSCode. Powered by the Tensorflow framework, the LSTM model was able to be written in a sophisticated, yet simple way. On the otherhand, the "yFinance" imports were used to fetch historical stock data, while "Pandas" was used for the data handling. However, the actual data preprocessing was carried out with Scikit by implementing its MinMaxScaler. Finally, Matplotlib was deployed for visualizing the actual and predicted stock prices.

Challenges we ran into

In essence, dealing with any sort of financial data is challenging due to its non-stationary nature. On the other hand, fine-tuning the hyperparameters of the LSTM model was time-consuming, as it had to be written in a way to optimize performance. And of course, the model would often overfit, which was a significant problem, as I had to figure out a way to balance its ability to generalize from the historical data while staying independent of the original input.

Accomplishments that we're proud of

This working model has a reasonable degree of accuracy, and that is what I am most proud of. I initially believed that a smaller model such as this would not be able to predict stock prices accurately, but after seeing the epochs complete and generate the graph, I was shocked to see its similarity between the predicted and actual price.

What we learned

I deepened my understanding of how LSTM models work, and how it is applicable to many different areas of finance, not just in stocks. I also learned that AI has massive potential in the business world, and it is exciting to see what future technology holds.

What's next for Neural_Network_to_Predict_Stock_Prices

This model had several limitations, such as having no indicators from technical analysis and low volume data. In the future, I hope to explore deep Q-learning implementations for stock predictions, as they have shown promising potential regarding prediction.

Built With

Share this project:

Updates

Submission history