CoolFace
Apppublic

Sahil-entr/food-demand-prediction

sourceHugging Faceupdated 3mo agoView on Hugging Face
1likes
App README

๐Ÿฅฃ Food Demand & Supply Prediction Wizard Dashboard

An ML-powered inventory demand forecasting dashboard designed for food supply chains. This application provides a modern, clean, and interactive single-page step-by-step wizard workflow that guides users through importing datasets, training machine learning models, comparing performance evaluation metrics, and forecasting target orders.


๐ŸŽจ Design & Aesthetic Style

  • โ€”Premium Theme: Soft light background palette featuring slate-grey layouts (#f8fafc & #ffffff), deep indigo accents (#4f46e5), and emerald success signals.
  • โ€”Micro-Animations: Features hover scaling on grid cards, loading skeletons, responsive overlays, and fade-in transitions.
  • โ€”Responsive Layout: Designed with a fluid grid structure that adapts seamlessly across all devices:
  • โ€”Large Screens: Expanded full-sidebar steps tracker.
  • โ€”Tablets (601px - 1024px): Space-saving icon-only vertical stepper.
  • โ€”Mobile (<=600px): Floating horizontal top tab navigation bar with flex-wrapped block forms.

๐Ÿงญ Step-by-Step Wizard Workflow

1๏ธโƒฃ Step 1: Feed Data

  • โ€”Drag-and-Drop Dropzones: Custom drag-and-drop cards to upload the required files:
  • โ€”train.csv (Historical transaction data)
  • โ€”fulfilment_center_info.csv (Details about fulfillment centers)
  • โ€”testData.csv (Future periods to forecast)
  • โ€”โšก Preloaded Sample Data: Option to load default dataset instantly.
  • โ€”Explorer Toolbar: Includes an interactive KPI dashboard and a searchable, paginated tabular view of the first 50 merged database records.

2๏ธโƒฃ Step 2: Train Models

  • โ€”Algorithm Selection: Check or uncheck 8 different algorithms to train:
  • โ€”Classical ML: Random Forest, Gradient Boosting, LightGBM, CatBoost, XGBoost.
  • โ€”Deep Learning: LSTM, Bi-LSTM, CNN (1D).
  • โ€”โšก Quick Training Mode: (Enabled by default) Automatically samples a subset of the dataset and runs limited epochs for Keras models, letting all models complete training in seconds. Disable to train on the full dataset.

3๏ธโƒฃ Step 3: Compare Models

  • โ€”Metrics Leaderboard: Compare trained models side-by-side on five metrics: RMSLE, MSE, RMSE, MAE, and MAPE. The best score for each metric is highlighted in a green pill.
  • โ€”RMSE Comparison Chart: Interactive Chart.js bar graph displaying error metrics.

4๏ธโƒฃ Step 4: Visuals & Forecasts

  • โ€”Fulfillment Distribution: Generates doughnut, bar, and horizontal bar charts on-demand to display center type volumes, regional splits, and top 15 highest-volume centers.
  • โ€”Demand Forecasting Engine: select any trained model checkpoint to predict future orders from testData.csv, displaying a searchable table and an interactive bar graph.

๐Ÿ› ๏ธ Technology Stack

  • โ€”Backend: Python 3.10+, Flask, Pandas, NumPy, Scikit-Learn, LightGBM, XGBoost, CatBoost, TensorFlow (Keras), H5py.
  • โ€”Frontend: HTML5 (Semantic), CSS3 (Flexbox/Grid), JavaScript (ES6+), Chart.js (CDN).
  • โ€”Deployment/WSGI: Gunicorn.

๐Ÿš€ Getting Started

Prerequisites

  • โ€”Python 3.10 or 3.11 installed.

Installation

  1. 1.Clone the repository to your local machine:
bash
   git clone https://github.com/YOUR_USERNAME/food-demand-prediction-dashboard.git
   cd food-demand-prediction-dashboard
  1. 1.Install the required dependencies:
bash
   pip install -r requirements.txt

(Note: The `requirements.txt` locks working versions of NumPy and TensorFlow to prevent version mismatches).

  1. 1.Start the Flask server:
bash
   python app.py
  1. 1.Open your browser and navigate to: [http://localhost:5000](http://localhost:5000)

๐Ÿ“‚ Project Structure

bash
โ”œโ”€โ”€ Dataset/                   # Directory containing CSV datasets
โ”‚   โ”œโ”€โ”€ train.csv              # Historical transaction data
โ”‚   โ”œโ”€โ”€ fulfilment_center_info.csv # Center details data
โ”‚   โ””โ”€โ”€ testData.csv           # Forecast target data
โ”œโ”€โ”€ model/                     # Trained deep learning weight files
โ”œโ”€โ”€ static/
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ””โ”€โ”€ style.css          # Vanilla CSS layout styles & responsive queries
โ”‚   โ””โ”€โ”€ js/
โ”‚       โ””โ”€โ”€ app.js             # API communications, navigation, & Chart.js logic
โ”œโ”€โ”€ templates/
โ”‚   โ””โ”€โ”€ index.html             # HTML5 wizard dashboard layout template
โ”œโ”€โ”€ app.py                     # Flask backend controllers & training server
โ”œโ”€โ”€ Procfile                   # Process file for cloud web deployments
โ”œโ”€โ”€ .gitignore                 # Files excluded from git tracking
โ”œโ”€โ”€ requirements.txt           # Main web application dependencies
โ”œโ”€โ”€ requirements_notebook.txt  # Jupyter Notebook legacy dependencies
โ””โ”€โ”€ deployment_guide.md        # Detailed guide for pushing to GitHub & Render

โ˜๏ธ Deployment

This repository is pre-configured with a `Procfile` and a production-grade `requirements.txt` for cloud deployments (like Render or Heroku):

  • โ€”Build Command: pip install -r requirements.txt
  • โ€”Start Command: gunicorn app:app

See [deployment_guide.md](file:///c:/Users/sahil/OneDrive/Desktop/food%20demand%20FRont%20end/24.%20Food%20Demand/24.%20Food%20Demand/FoodDemandSupply/FoodDemandSupply/deployment_guide.md) for detailed instructions.