StoxChai NSE Stock Price Prediction Models
Overview
This repository contains machine learning models trained on NSE (National Stock Exchange of India) bhavcopy data for stock price prediction. The models are trained on data from January 1, 2025 to August 20, 2025, covering 3,257 unique stock symbols across 158 trading days.
Model Information
Data Source
- Source: NSE Bhavcopy (daily market data)
- Period: January 1, 2025 - August 20, 2025
- Coverage: 3,257 Indian equity stocks
- Features: 16 technical and price-based features
Features Used
- Price Data: Open, High, Low, Close, Last Price, Previous Close
- Technical Indicators: Price Range, Price Change, Price Change %, Volume-Price Ratio
- Moving Averages: SMA_5, SMA_20
- Momentum: Price Momentum, Volume MA, Volume Ratio
- Volume: Total Trading Volume, Total Trading Value
Models Available
- RandomForest - Ensemble of 100 decision trees
- GradientBoosting - Gradient boosting with 100 estimators
- LinearRegression - Linear regression model
- Ridge - Ridge regression with L2 regularization
- Lasso - Lasso regression with L1 regularization
- SVR - Support Vector Regression
- XGBoost - Extreme Gradient Boosting
- LightGBM - Light Gradient Boosting Machine
Usage
Installation
pip install -r requirements.txt
Quick Start
from inference import StoxChaiStockPredictor
import numpy as np
# Initialize predictor
predictor = StoxChaiStockPredictor()
# Prepare your data (16 features in the same order as training)
features = [100.0, 105.0, 98.0, 102.0, 100.0, 7.0, 2.0, 2.0, 1.5,
101.0, 100.5, 0.01, 1000.0, 1.2, 1200.0, 120000.0]
# Single model prediction
prediction = predictor.predict(features, "randomforest")
print(f"Predicted stock price: ₹{prediction:.2f}")
# All models prediction
all_predictions = predictor.predict_all_models(features)
print(f"Ensemble prediction: ₹{all_predictions['ensemble']:.2f}")
Input Format
Your input should be a 1D array with exactly 16 features in this order:
- OpnPric (Open Price)
- HghPric (High Price)
- LwPric (Low Price)
- LastPric (Last Price)
- PrvsClsgPric (Previous Close Price)
- Price_Range
- Price_Change
- Price_Change_Pct
- Volume_Price_Ratio
- SMA_5
- SMA_20
- Price_Momentum
- Volume_MA
- Volume_Ratio
- TtlTradgVol (Total Trading Volume)
- TtlTrfVal (Total Trading Value)
Performance Metrics
- Training Data: 464,548 samples
- Validation: 20% holdout test set
- Models trained successfully: 8/8
- All models converged without errors
License
MIT License - See LICENSE file for details
Citation
If you use these models in your research, please cite:
@software{stoxchai_nse_predictor,
title={StoxChai NSE Stock Price Prediction Models},
author={StoxChai Team},
year={2025},
url={https://huggingface.co/thoutam/stoxchai-nse-predictor}
}
Support
For questions or issues, please open an issue on this repository.
- Downloads last month
- 6
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support