Skip to content

Repository files navigation

SuperKart Sales Forecasting

Random Forest regression model predicting product-level sales for a retail chain — achieving R²=0.93 — deployed as a Flask REST API on HuggingFace Spaces.

Results

Metric Score
R² (test) 0.93
Model Random Forest Regressor
Deployment HuggingFace Spaces (Flask REST API)

What It Does

  1. Analyzes historical sales data across product categories, outlet types, and item attributes
  2. Engineers features (MRP buckets, outlet age, item visibility normalization)
  3. Trains and tunes a Random Forest model
  4. Exposes predictions via a REST API endpoint

Tech Stack

  • Model: Random Forest Regressor (scikit-learn)
  • Feature Engineering: Pandas, NumPy
  • API: Flask
  • Deployment: HuggingFace Spaces
  • Visualization: Matplotlib, Seaborn

Files

File Description
superkart_sales_forecasting.ipynb Full EDA + model training notebook
Full_Code_SuperKart_Model_Deployment_Notebook.ipynb Flask API deployment notebook
SuperKart.csv Training dataset

Key Features Driving Sales

Item MRP, outlet type, outlet establishment year, item visibility, item weight — identified via feature importance analysis.

API Usage

POST /predict
Content-Type: application/json

{
  "Item_MRP": 249.0,
  "Outlet_Type": "Supermarket Type1",
  "Outlet_Age": 14,
  "Item_Visibility": 0.05
}

Response: { "predicted_sales": 2847.3 }

Skills Demonstrated

Regression modeling, hyperparameter tuning, feature engineering, model serialization, REST API development, cloud deployment

About

Random Forest sales forecasting R2=0.93 deployed as Flask API on HuggingFace Spaces

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages