← Back to Portfolio

Stock Market Forecasting

Tech Stack: Python, Pandas, NumPy, Matplotlib, Scikit-learn, yfinance, Statsmodels, TensorFlow/Keras

This project explores time series forecasting techniques by comparing statistical models (ARIMA, SARIMA) with deep learning approaches (LSTM) for predicting stock prices of three major tech companies—Google (GOOGL), Apple (AAPL), and Amazon (AMZN).

Problem Statement

Stock price prediction is one of the most challenging problems in financial analysis due to market volatility and complex temporal dependencies. This project explores whether deep learning models can capture sequential patterns better than traditional statistical approaches for short-term price forecasting, while demonstrating advanced time series modeling techniques.

Overview

Technical Approach

Data Engineering: Collected and preprocessed historical stock data with proper scaling and normalization for neural network training.

Feature Engineering: Created lag features, rolling statistics (moving averages, volatility), and technical indicators to capture market dynamics.

Statistical Modeling: Implemented ARIMA and SARIMA models using Statsmodels, with proper stationarity testing and parameter optimization.

Deep Learning Architecture: Designed LSTM neural network with multiple layers, dropout regularization, and optimized sequence length for temporal pattern recognition.

Model Validation: Used time-based train/validation/test splits to prevent data leakage and ensure realistic evaluation.

Key Achievements

Results & Analysis

The LSTM model dramatically outperformed traditional statistical methods across all three stocks:

The results demonstrate deep learning's superior ability to capture complex temporal patterns in financial data. LSTM consistently achieved 80-90% better accuracy than traditional methods, though performance varied during high volatility periods, highlighting both the potential and limitations of machine learning in financial forecasting.

đź”— View Code on GitHub