Stock Price Prediction

A deep learning project for financial time-series forecasting — stacked LSTM architecture, trained and evaluated on real market data.

AI / ML

Stock Price Prediction — Stacked LSTM

A financial forecasting model built to explore how deep learning handles the noise and non-linearity of real stock market data — trained end-to-end with full evaluation metrics.

Type

Research Project

Status

Completed

Year

2024

Category

Machine Learning

Stock Price Prediction results
Training loss curve
Prediction vs actual plot

Project Overview

A time-series forecasting model built using a stacked LSTM architecture on OHLC (Open, High, Low, Close) stock data. The model was trained on historical price sequences normalized with MinMaxScaler and evaluated using RMSE and MAE metrics against a held-out test set.

The Challenge

Stock price data is inherently noisy and non-linear — standard regression approaches fail to capture temporal dependencies. The challenge was building a model that generalizes across market conditions without overfitting to historical trends.

The Approach

I built a stacked LSTM in PyTorch with two recurrent layers and a fully connected output. Data was preprocessed with sliding window sequences (60-day lookback), normalized, and split 80/20 for training and testing. Loss curves and prediction plots were generated to validate model behavior.

Model Performance

A validated forecasting model that captures price trends with quantified error metrics on real market data.

LSTM
Architecture
60d
Lookback Window
RMSE
Primary Metric
PyTorch
Framework

Technology Stack

Modeling

PyTorchStacked LSTMMinMaxScaler

Data

PandasNumPyOHLC Dataset

Evaluation

RMSEMAEMatplotlibSeaborn

Key Features

A rigorous ML pipeline from raw data to evaluated predictions.

Stacked LSTM Architecture

Two-layer LSTM with dropout regularization — designed to capture multi-scale temporal patterns in price sequences.

Full Evaluation Pipeline

RMSE and MAE computed on the held-out test set, with predicted vs. actual plots generated for visual validation.

Proper Data Preprocessing

Sliding window sequencing, MinMaxScaler normalization, and 80/20 train/test split applied before training.