Skip to content

DevyaniD19/MNC-Stock-Market-Price-Prediction

Repository files navigation

📈 MNC Stock Market Price Prediction

Python Keras scikit-learn License: MIT

Time-series stock price forecasting using Random Forest, LSTM (Deep Learning), and ARIMA on IBM historical stock data.

📌 Overview

This project applies three distinct forecasting approaches to IBM stock price data, comparing their predictive power on closing prices:

  • Random Forest Regressor — ensemble tree-based approach
  • LSTM Neural Network — 4-layer stacked LSTM with Dropout regularisation
  • ARIMA / Auto-ARIMA — classical time-series decomposition and forecasting

🗂️ Repository Structure

MNC-Stock-Market-Price-Prediction/
├── MNC_Stock_Market_Price_Prediction.ipynb   # Full analysis and modelling notebook
├── mnc_stock_market_price_prediction.py      # Python script version
├── IBM Stock Data.csv                        # Historical IBM stock data (OHLCV)
├── requirements.txt                          # Python dependencies
└── README.md                                 # This file

📊 Dataset

Feature Description
Date Trading date
Open Opening price (USD)
High Intraday high price (USD)
Low Intraday low price (USD)
Close Closing price (USD) — target variable
Volume Number of shares traded
Name Ticker symbol (IBM)

🧠 Model Architectures

🌲 Random Forest

  • 100 decision trees with bootstrap aggregation
  • Features: lag prices, rolling mean, rolling std
  • Evaluated on 20% holdout set

🔁 LSTM (Long Short-Term Memory)

Layer 1: LSTM(50, return_sequences=True) + Dropout(0.2)
Layer 2: LSTM(50, return_sequences=True) + Dropout(0.2)
Layer 3: LSTM(50, return_sequences=True) + Dropout(0.2)
Layer 4: LSTM(50) + Dropout(0.2)
Output:  Dense(1)
  • Optimizer: Adam | Loss: Mean Squared Error
  • Look-back window: 60 days

📉 ARIMA

  • Augmented Dickey-Fuller (ADF) test for stationarity
  • Seasonal decomposition (trend, seasonal, residual)
  • Auto-ARIMA for optimal (p, d, q) selection

📈 Results

Model RMSE
Random Forest ~4.2
LSTM ~3.1
ARIMA ~5.8

LSTM achieves the lowest RMSE, capturing long-term temporal dependencies in the stock price sequence.

🔮 Future Work

  • Add Bidirectional LSTM and GRU variants
  • Incorporate sentiment analysis from financial news (NLP)
  • Multi-stock portfolio prediction
  • Real-time prediction dashboard with Streamlit
  • Add technical indicators: RSI, MACD, Bollinger Bands

⚙️ Setup

pip install -r requirements.txt
jupyter notebook MNC_Stock_Market_Price_Prediction.ipynb

👩‍💻 Author

Devyani Deoregithub.com/DevyaniD19

📄 License

MIT License — see LICENSE for details.

About

IBM stock price forecasting using Random Forest, LSTM (4-layer), and ARIMA models with Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors