CoolFace
Apppublic

Job6742/Raw_Material_Predictor

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
README.md143 linesDownload Raw Back to root
1---2title: Raw Material Predictor3emoji: ๐Ÿข4colorFrom: purple5colorTo: pink6sdk: docker7pinned: false8---9 10---11title: Raw Material Predictive Model12emoji: โš™๏ธ13colorFrom: orange14colorTo: yellow15sdk: docker16pinned: true17---18 19# โš™๏ธ Raw Material Predictive Model20 21<div align="center">22 23# ๐ŸŒ [๐Ÿ‘‰ CLICK HERE โ€” OPEN LIVE APP](https://huggingface.co/spaces/Job6742/raw-material-predictor)24### ๐Ÿ”— https://huggingface.co/spaces/Job6742/raw-material-predictor25 26*ML-powered inventory intelligence dashboard โ€” works in any browser, no installation needed*27 28---29 30[![GitHub](https://img.shields.io/badge/GitHub-Source%20Code-181717?style=for-the-badge&logo=github)](https://github.com/ponjose004/Raw-Material-Prediction)31[![HuggingFace](https://img.shields.io/badge/๐Ÿค—%20Hugging%20Face-Spaces-orange?style=for-the-badge)](https://huggingface.co/spaces/Job6742/raw-material-predictor)32[![Python](https://img.shields.io/badge/Python-3.10-blue?style=for-the-badge&logo=python)](https://python.org)33[![Flask](https://img.shields.io/badge/Flask-Web%20App-black?style=for-the-badge&logo=flask)](https://flask.palletsprojects.com)34 35</div>36 37---38 39## ๐Ÿ“Œ About This Project40 41A 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.42 43> ๐Ÿ”— **Full source code, documentation, and desktop (.exe) version available on GitHub:**44> **[github.com/ponjose004/Raw-Material-Prediction](https://github.com/ponjose004/Raw-Material-Prediction)**45 46---47 48## โœ… Features49 50| Feature | Description |51|---|---|52| ๐Ÿ“Š Stock level bars | Color-coded visual bars (green / yellow / red) per material |53| ๐Ÿค– ML Prediction | Predicts daily consumption using HistGradientBoostingRegressor |54| ๐Ÿ“… Days Remaining | Estimates how long stock will last โ€” normal / high / low range |55| โš ๏ธ Alerts Panel | Flags materials unused 30+ days or below terminal stock level |56| ๐Ÿ“ Upload Excel | Upload master Excel โ€” auto-splits and saves by material |57| โž• Add Daily Data | Log purchase and usage via web form |58| ๐Ÿ“ˆ Charts | 10-month bar chart + 30-day trend line chart per material |59 60---61 62## ๐Ÿง  How the ML Works63 641. Reads each material's daily stock Excel file652. Filters to last 10 months of non-zero consumption data663. Creates **21 lag features** from the `Total` usage column (past 21 days as memory)674. Trains a **HistGradientBoostingRegressor** โ€” a fast, robust gradient boosting model685. Predicts tomorrow's daily consumption696. Divides current stock by prediction โ†’ **days remaining**707. Applies ยฑ30% range for high / normal / low consumption scenarios71 72---73 74## ๐Ÿ—‚๏ธ Dataset Format75 76Each `.xlsx` file in the `raw/` folder follows this structure:77 78| Column | Description |79|---|---|80| `Date` | Date of the record |81| `Opening` | Opening stock for the day |82| `Purchase` | Quantity purchased |83| `Line_1` / `Line_2` | Consumption per production line |84| `Total` | Total consumption (Line_1 + Line_2) |85| `Closing` | Closing stock = Opening + Purchase โˆ’ Total |86 87> โš ๏ธ The Excel files bundled here contain **randomly generated sample data only**. Real data is confidential and not included.88 89---90 91## ๐Ÿ’ป Run Locally92 93```bash94# Clone from GitHub95git clone https://github.com/ponjose004/Raw-Material-Prediction.git96cd Raw-Material-Prediction97 98# Install dependencies99pip install -r requirements.txt100 101# Run102python app.py103# Open http://localhost:7860104```105 106> ๐Ÿ“ฆ A standalone Windows **.exe** download is also available on the107> [GitHub Releases page](https://github.com/ponjose004/Raw-Material-Prediction/releases/latest)108 109---110 111## ๐Ÿงฐ Tech Stack112 113| Layer | Technology |114|---|---|115| Web Framework | Flask |116| ML Model | scikit-learn โ€” HistGradientBoostingRegressor |117| Data Processing | pandas, numpy |118| Charts | Chart.js |119| Deployment | Hugging Face Spaces (Docker) |120| Desktop Version | PyQt5 |121 122---123 124## ๐Ÿ”— Links125 126| | Link |127|---|---|128| ๐ŸŒ Live App | [huggingface.co/spaces/Job6742/raw-material-predictor](https://huggingface.co/spaces/Job6742/raw-material-predictor) |129| ๐Ÿ’ป Source Code | [github.com/ponjose004/Raw-Material-Prediction](https://github.com/ponjose004/Raw-Material-Prediction) |130| ๐Ÿ“ฆ Download .exe | [GitHub Releases](https://github.com/ponjose004/Raw-Material-Prediction/releases/latest) |131 132---133 134## ๐Ÿ‘ค Author135 136**ponjose004**137- ๐Ÿ™ GitHub: [@ponjose004](https://github.com/ponjose004)138- ๐Ÿค— Hugging Face: [@Job6742](https://huggingface.co/Job6742)139 140---141 142> *This Space is deployed via Docker. The Flask server runs on port 7860 as required by Hugging Face Spaces.*143