‎ ‎

Next Day Stock Price Prediction with LSTM Forecasting

Jun 2024

My Portfolio Website

Background :

As part of my Deep Learning final project, I built an LSTM-based time-series model to predict the next-day closing price of Amazon (AMZN) and Cisco (CSCO) stocks. I prepared the historical closing-price data using a 5-day window to predict the following day, then split the data into 80% training, 10% validation, and 10% test sets. The baseline model used a 50-unit LSTM with ReLU activation followed by a single dense output layer, and was evaluated using RMSE, MAE, and MAPE.

Image Input and Output Sample

I also experimented with model architecture and training strategies by applying Early Stopping and, for CSCO, adding a second LSTM layer. Early Stopping significantly improved the AMZN model, reducing its test RMSE from 72.2 to 40.01, MAE from 63.58 to 29.18, and MAPE from 3.65% to 1.7%. For CSCO, the baseline model achieved a test RMSE of 0.79, MAE of 0.54, and MAPE of 1.25%, while the two-layer architecture resulted in slightly higher errors.

Here are the visualizations of the predicted price vs the actual price

Image Input and Output Sample Image Input and Output Sample

See the code here: Google Colab

More on my thought process here: Youtube

‎ ‎