Skip to content

Ansarafsar/ai_ml_dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

π‘πžπ­πšπ’π₯π’π²π§πœ π€πˆ: πŒπ‹-𝐏𝐨𝐰𝐞𝐫𝐞𝐝 π’πšπ₯𝐞𝐬 π…π¨π«πžπœπšπ¬π­π’π§π  & 𝐁𝐈 𝐈𝐧𝐬𝐒𝐠𝐑𝐭𝐬

RetailSync AI Dashboard

RetailSync AI is a cutting-edge data science project that forecasts retail sales and delivers actionable business intelligence (BI) using a Kaggle dataset (100k records, India stores, 2019-2023). Built with Python, it combines machine learning (ML) models and large language model (LLM)-powered queries to empower retail decision-making. The project features exploratory data analysis (EDA), model training (Linear Regression, XGBoost, Random Forest, ARIMA, LSTM), and a dynamic Streamlit dashboard for real-time predictions and insights.

This repository showcases end-to-end skillsβ€”data preprocessing, feature engineering, ML pipelines, and interactive deploymentβ€”perfect for retail analytics innovation. A huge thank you to Abu Humza Khan for the Kaggle dataset (Store Sales Data), which fueled this project!

Features

  • Exploratory Data Analysis (EDA):
    • Cleans and preprocesses retail sales data.
    • Engineers features like Customer Lifetime Value (CLV) and Discount Impact.
    • Visualizes trends, customer segments, and discount-profit correlations.
  • Machine Learning Models:
    • Trains Linear Regression, XGBoost, Random Forest (RΒ² ~0.5–0.7), ARIMA, and LSTM (RΒ² ~0.7).
    • Evaluates with MSE, RΒ², and visualizes feature importance and forecasts.
  • Interactive Streamlit Dashboard:
    • ML Predictions: Sliders for Quantity, Discount, and more to forecast sales.
    • BI Insights: LLM-powered queries (Mistral-7B via OpenRouter) like β€œTop 5 sales in East.”
    • Visualizations: Dynamic Altair charts for top metrics and predictions.
  • Deployment: Runs locally or via Google Colab with Ngrok for public access.

Structure:

 RetailSync-AI/
β”œβ”€β”€ data/
β”‚   └── pp_df_data.csv              # Preprocessed retail sales data
β”œβ”€β”€ notebooks/
β”‚   β”œβ”€β”€ pp_fe_eda.ipynb             # Data preprocessing, feature engineering, EDA
β”‚   β”œβ”€β”€ ml_model_training.ipynb     # Train and save ML models
β”‚   └── llm_ml_integrated_dashboard.ipynb  # Build and launch Streamlit dashboard
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ linear_regression_model.pkl # Trained Linear Regression model
β”‚   β”œβ”€β”€ scaler_lr.pkl               # Scaler for Linear Regression
β”‚   β”œβ”€β”€ xgboost_model.pkl           # Trained XGBoost model
β”‚   β”œβ”€β”€ scaler_xgb.pkl              # Scaler for XGBoost
β”‚   β”œβ”€β”€ random_forest_model.pkl     # Trained Random Forest model
β”‚   β”œβ”€β”€ arima_model.pkl             # Trained ARIMA model
β”‚   β”œβ”€β”€ lstm_model.h5               # Trained LSTM model
β”œβ”€β”€ app.py                          # Streamlit dashboard code
β”œβ”€β”€ requirements.txt                # Python dependencies
└── README.md                       # Project documentation

Prerequisites

Install Dependencies:

pip install -r requirements.txt
  • Python: 3.8+
  • Dependencies: Listed in requirements.txt
  • Accounts:
    • OpenRouter for LLM API key (free tier available).
    • Ngrok for public URL (free account sufficient).
  • Dataset: Kaggle retail sales data (provided as pp_df_data.csv after preprocessing).

Set Environment Variables:

Create a .env file or set secrets in Colab:

OPENROUTER_API_KEY=your-openrouter-key
NGROK_TOKEN=your-ngrok-token

Setup

  1. Clone the Repository:
    git clone https://github.com/your-username/Retail-Sales-Prediction-Dashboard.git
    cd Retail-Sales-Prediction-Dashboard
  2. Launch Dashboard:
    streamlit run app.py
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published