Sequence-Based Forecasting
Implemented an LSTM neural network in PyTorch to model patterns in historical stock-price sequences.
Time Series Forecasting · Full-Stack Development
A financial forecasting application that uses a PyTorch LSTM model to learn patterns in historical stock-price data and a Next.js interface to visualize predictions.

The Project
Financial markets produce large amounts of time-series data, making historical stock prices a useful setting for exploring sequence-based machine learning models.
I developed a financial forecasting application that uses a Long Short-Term Memory (LSTM) neural network to generate predictions from historical stock-price data.
The project combines a PyTorch forecasting model with a FastAPI backend and a Next.js frontend. Users can interact with the application and view predicted values alongside historical price information.
My primary focus was understanding the end-to-end process of preparing sequential data, training a forecasting model, exposing predictions through an API, and visualizing the results in a web application.
Key Contributions
Implemented an LSTM neural network in PyTorch to model patterns in historical stock-price sequences.
Connected a Python forecasting backend to a Next.js frontend through a FastAPI interface.
Built a frontend visualization to compare historical values and model-generated predictions.
Behind the Build
Time-series forecasting involves predicting future observations using information from earlier points in a sequence.
This project explored how a recurrent neural network could learn patterns from historical stock-price data and generate forecasts.
The goal was to build an end-to-end machine learning application rather than a production trading system.
The application uses historical stock-price data retrieved through the yfinance Python library.
The forecasting pipeline prepares sequential training examples using windows of historical observations.
For the initial implementation, I used sequences of 60 observations to provide the model with historical context.
Preparing these sequences required transforming the original time-series data into the input structure expected by the LSTM model.
The forecasting model is implemented in PyTorch using a Long Short-Term Memory neural network.
LSTMs are designed to process sequential information and can learn relationships across multiple time steps.
The model takes a window of historical observations as input and generates a prediction based on patterns learned during training.
This implementation provided practical experience working with recurrent neural networks and sequential data.
I developed a FastAPI backend to connect the forecasting model to the frontend application.
The backend exposes forecasting functionality through an HTTP endpoint that accepts a stock ticker and returns model-generated results.
Keeping the forecasting logic on the backend separates machine learning responsibilities from the user interface.
This architecture also makes it easier to update the forecasting pipeline independently of the frontend.
The frontend is built with Next.js and TypeScript.
It communicates with the FastAPI backend to request forecasts and display the returned information.
A chart presents actual and predicted values, allowing users to visually examine how the model's output relates to the historical data.
Building the interface required coordinating asynchronous API requests, response handling, and chart rendering.
Financial forecasting is difficult because market prices are influenced by many factors that may not be represented in historical price sequences.
An LSTM can learn patterns in training data without necessarily producing reliable predictions on unseen market conditions.
Potential future improvements include comparing the model against simple forecasting baselines, implementing more rigorous walk-forward validation, evaluating multiple market conditions, and measuring forecasting error quantitatively.
This project is a machine learning demonstration and is not intended to provide investment advice or reliable trading signals.