Project Image
Test Application

The workflow begins with data collection using yfinance, retrieving ten years of stock data for user-specified tickers such as Apple (AAPL). The raw dataset is explored and cleaned, removing null values and generating statistical summaries. Feature engineering includes calculating 100-day and 200-day moving averages, which help visualize long-term and short-term market trends. The data is then split into training and testing sets, scaled to a 0–1 range using MinMaxScaler to improve model performance.

The sequence creation process converts time-series data into structured input suitable for LSTM training, where each sequence of historical prices predicts the next closing price. The LSTM neural network, implemented using TensorFlow/Keras, captures temporal dependencies in the data, outperforming traditional regression approaches for financial forecasting. After training, the model generates predictions that are inverse-transformed back to the original price scale. Performance metrics such as Mean Squared Error (MSE), Root Mean Squared Error (RMSE), and R-squared (R²) quantify prediction accuracy.

The trained model is integrated into a Django REST API, which serves as the backend for a React-based dashboard. The frontend dynamically displays actual vs. predicted stock prices, moving average charts, and R² values to indicate model fit. Users can enter any stock ticker, and the system fetches live market data, processes it through the LSTM model, and renders visual outputs instantly.

This architecture merges machine learning, data visualization, and modern web development, providing a predictive analytics portal that demonstrates the end-to-end lifecycle from data acquisition and AI modeling to real-time web deployment. The project showcases how deep learning models like LSTM can be practically integrated into web applications for intelligent financial forecasting.

Back