Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StockMarketPrediction

A comprehensive financial data analysis and machine learning optimization project. This repository implements and compares 9 different mathematical and machine learning models to analyze, forecast, and predict stock market pricing trends using historical data.


📖 Overview

Predicting stock market prices is a challenging time-series forecasting problem. This project processes historical data from the National Stock Exchange (NSE) to train and evaluate various predictive algorithms. By comparing advanced Deep Learning (LSTM), automated time-series forecasting (Auto-ARIMA, Prophet), and classical Machine Learning (Random Forest, SVM), this project attempts to find the most robust approach to estimate future price movements.

📊 Data Source & Characteristics

  • Asset: Infosys (INFY)
  • Exchange: NSE India (National Stock Exchange)
  • Timeframe: July 1, 2015 – July 29, 2020
  • Features Provided:
    • Date: Traded day.
    • Open / Close: Opening and closing price of the asset.
    • High / Low: Maximum and minimum price reached during the session.
    • Volume: Total number of shares traded.

🛠 Data Processing Pipeline

  1. Cleaning: Missing (NaN) values detection and imputation/removal.
  2. Date Transformation: Parsing temporal strings into standardized timestamp types (pd.to_datetime) for robust time-series indexing.
  3. Feature Scaling: Normalization via Scikit-Learn's MinMaxScaler bound to (0,1) to stabilize gradient descent and proximity-based classifiers.
  4. Data Splitting: Splitting timeline chronologically into Training Sets (historical patterns) to Validation Sets (future timeline).

🚀 Implemented Models

The repository evaluates 9 different algorithms, split by methodology:

Regression & Time-Series

  • Linear Regression: A baseline statistical approach for mapping feature relations directly to prices.
  • LSTM (Long Short-Term Memory): Advanced Deep Learning Recurrent Neural Network (RNN) tailored for time-series anomaly and pattern persistence.

Classification & Structuring Models

📈 Evaluation Metrics

Model performance and ranking comparisons are formulated against:

  • RMSE (Root Mean Squared Error): Standard deviation of prediction errors. Defines standard variance for regression fits.
  • Accuracy: Base evaluation metric for trend prediction states (up/down).

⚙️ Setup & Installation

Follow these steps to initialize the environment:

  1. Clone the repository:

    git clone https://github.com/arshsaxena/StockMarketPrediction.git
    cd StockMarketPrediction
  2. Set up Virtual Environment (Recommended):

    python3 -m venv .venv
    source .venv/bin/activate  # On Windows use: .venv\Scripts\activate
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Launch Jupyter Notebook Server:

    jupyter notebook
  5. Begin Analysis: Open any specific model's .ipynb file to run cells interactively.


Note: All algorithms provided here are evaluated for academic and educational analytics purposes only and should not be deployed as independent financial trading advice.

About

Stock Market Prediction for Infosys (NSE: INFY) using Machine Learning and Deep Learning

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages