CoolFace
Apppublic

Job6742/Raw_Material_Predictor

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

title: Raw Material Predictive Model emoji: ⚙️ colorFrom: orange colorTo: yellow sdk: docker pinned: true ---

⚙️ Raw Material Predictive Model

<div align="center">

🌐 👉 CLICK HERE — OPEN LIVE APP

🔗 https://huggingface.co/spaces/Job6742/raw-material-predictor

ML-powered inventory intelligence dashboard — works in any browser, no installation needed


![GitHub](https://github.com/ponjose004/Raw-Material-Prediction) ![HuggingFace](https://huggingface.co/spaces/Job6742/raw-material-predictor) ![Python](https://python.org) ![Flask](https://flask.palletsprojects.com)

</div>


📌 About This Project

A full-stack AI web application that monitors raw material stock levels in real time, predicts how long current stock will last using machine learning, and raises automatic alerts when materials are running low or unused.

🔗 Full source code, documentation, and desktop (.exe) version available on GitHub: [github.com/ponjose004/Raw-Material-Prediction](https://github.com/ponjose004/Raw-Material-Prediction)

✅ Features

FeatureDescription
📊 Stock level barsColor-coded visual bars (green / yellow / red) per material
🤖 ML PredictionPredicts daily consumption using HistGradientBoostingRegressor
📅 Days RemainingEstimates how long stock will last — normal / high / low range
⚠️ Alerts PanelFlags materials unused 30+ days or below terminal stock level
📁 Upload ExcelUpload master Excel — auto-splits and saves by material
➕ Add Daily DataLog purchase and usage via web form
📈 Charts10-month bar chart + 30-day trend line chart per material

🧠 How the ML Works

  1. 1.Reads each material's daily stock Excel file
  2. 2.Filters to last 10 months of non-zero consumption data
  3. 3.Creates 21 lag features from the Total usage column (past 21 days as memory)
  4. 4.Trains a HistGradientBoostingRegressor — a fast, robust gradient boosting model
  5. 5.Predicts tomorrow's daily consumption
  6. 6.Divides current stock by prediction → days remaining
  7. 7.Applies ±30% range for high / normal / low consumption scenarios

🗂️ Dataset Format

Each .xlsx file in the raw/ folder follows this structure:

ColumnDescription
DateDate of the record
OpeningOpening stock for the day
PurchaseQuantity purchased
Line_1 / Line_2Consumption per production line
TotalTotal consumption (Line1 + Line2)
ClosingClosing stock = Opening + Purchase − Total
⚠️ The Excel files bundled here contain randomly generated sample data only. Real data is confidential and not included.

💻 Run Locally

bash
# Clone from GitHub
git clone https://github.com/ponjose004/Raw-Material-Prediction.git
cd Raw-Material-Prediction

# Install dependencies
pip install -r requirements.txt

# Run
python app.py
# Open http://localhost:7860
📦 A standalone Windows .exe download is also available on the GitHub Releases page

🧰 Tech Stack

LayerTechnology
Web FrameworkFlask
ML Modelscikit-learn — HistGradientBoostingRegressor
Data Processingpandas, numpy
ChartsChart.js
DeploymentHugging Face Spaces (Docker)
Desktop VersionPyQt5

🔗 Links


👤 Author

ponjose004


This Space is deployed via Docker. The Flask server runs on port 7860 as required by Hugging Face Spaces.