{"id":19682469,"url":"https://github.com/rayyan9477/machine-learning-driven-backorder-prediction-system","last_synced_at":"2026-04-12T15:06:33.168Z","repository":{"id":250615538,"uuid":"834955633","full_name":"Rayyan9477/Machine-Learning-Driven-Backorder-Prediction-System","owner":"Rayyan9477","description":"Experience a state-of-the-art Django web application designed to predict product backorders with exceptional accuracy. This platform leverages advanced machine learning techniques, incorporating pre-trained Random Forest Classifier, Decision Tree, and LGBM models.","archived":false,"fork":false,"pushed_at":"2024-09-06T21:44:00.000Z","size":2938,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T06:06:24.285Z","etag":null,"topics":["matplotlib","notebook","numpy","pandas","python","scikit-learn"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rayyan9477.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-28T20:12:51.000Z","updated_at":"2024-09-06T21:44:04.000Z","dependencies_parsed_at":"2024-09-07T00:24:53.175Z","dependency_job_id":"fdc26fd0-37b4-4873-869c-90acf8a3a231","html_url":"https://github.com/Rayyan9477/Machine-Learning-Driven-Backorder-Prediction-System","commit_stats":null,"previous_names":["rayyan9477/machine-learning-driven-backorder-prediction-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rayyan9477%2FMachine-Learning-Driven-Backorder-Prediction-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rayyan9477%2FMachine-Learning-Driven-Backorder-Prediction-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rayyan9477%2FMachine-Learning-Driven-Backorder-Prediction-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rayyan9477%2FMachine-Learning-Driven-Backorder-Prediction-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rayyan9477","download_url":"https://codeload.github.com/Rayyan9477/Machine-Learning-Driven-Backorder-Prediction-System/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240990996,"owners_count":19889991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matplotlib","notebook","numpy","pandas","python","scikit-learn"],"created_at":"2024-11-11T18:10:57.957Z","updated_at":"2026-04-12T15:06:32.586Z","avatar_url":"https://github.com/Rayyan9477.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Title: Machine Learning-Driven Backorder Prediction System\n\nExperience a state-of-the-art Django web application designed to predict product backorders with exceptional accuracy. This platform leverages advanced machine learning techniques, incorporating pre-trained Random Forest Classifier, Decision Tree, and LGBM models. By analyzing critical features such as product availability and lead time, it ensures precise and reliable backorder predictions, showcasing cutting-edge expertise in data science and machine learning.\n\n## Table of Contents\n\n- [Installation and Usage](#installation-and-usage)\n- [Features](#features)\n- [Development](#development)\n- [License](#license)\n- [Credits](#credits)\n\n## Installation and Usage\n\n### Cloning the Project\n\nTo clone this project, run the following command in your terminal:\n\n```bash\ngit clone https://github.com/Rayyan9477/Machine-Learning-Driven-Backorder-Prediction-System\n```\n\n### Creating Virtual Environment\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n### Getting Started\n\nNavigate to the project directory and follow the steps below to set up and run the project locally:\n\n```bash\ncd app\n```\n\n1. Install the required dependencies by running the following command:\n\n    ```bash\n    pip install -r requirement.txt\n    ```\n\n2. Run the Django migrations to set up the database:\n\n    ```bash\n    python3 manage.py makemigrations\n    python3 manage.py migrate\n    ```\n\n3. Start the Django development server:\n\n    ```bash\n    python3 manage.py runserver\n    ```\n\n4. Open your web browser and navigate to **`http://localhost:8000/`** to view the application.\n\n    The application has a simple web interface where you can input the product features and get a prediction on whether the product will go on backorder or not.\n\n    You can also make predictions using the API endpoint by sending a POST request to **`http://localhost:8000/predict/`** with a JSON payload containing the product features.\n\n## Libraries Used\n- **scikit-learn**\n- **numpy**\n- **pandas**\n- **Flask**\n- **joblib**\n- **requests**\n- **MatplotLib**\n- **Django**\n\n## Features\n\n- **Backorder Prediction:** Predict whether a product will go on backorder or not based on various features.\n- **Batch Prediction:** Provide a CSV file containing multiple product records for batch prediction of backorder status.\n- **Single Product Prediction:** Offer a form interface to input the features of a single product and obtain a prediction on its backorder status.\n\n## Result\n\nThe table below shows the performance metrics of different models on the backorder prediction task. The models evaluated are Decision Tree, Random Forest, and Light GBM. The dataset used for evaluation consists of train, validation, and test sets.\n\n| Model | Data Set | Accuracy | Recall | Precision |\n| --- | --- | --- | --- | --- |\n| Decision Tree | Train | 0.946 | 0.9651 | 0.9814 |\n|  | Valid | 0.8818 | 0.9079 | 0.8445 |\n|  | Test | 0.8633 | 0.8065 | 0.0605 |\n| Random Forest | Train | 0.9981 | 0.9982 | 0.9998 |\n|  | Valid | 0.9194 | 0.9513 | 0.9727 |\n|  | Test | 0.9003 | 0.8077 | 0.1878 |\n| Light GBM | Train | 0.9941 | 0.9954 | 0.9997 |\n|  | Valid | 0.9221 | 0.9513 | 0.9675 |\n|  | Test | 0.9069 | 0.7939 | 0.2052 |\n\n### Screenshots\n\n**Home Page**:\n\n![Home Page](images/home_page.png)\n\n**Predict:**\n\n![Predict](images/predict.png)\n\n**Result (Single Product Prediction):**\n\n![Single Product Prediction](images/single_prediction.png)\n\n**Result (Batch Prediction):**\n\n![Batch Prediction](images/batch_prediction.png)\n\n## Development\n\nThis application was developed using **Django 4**. The backorder prediction model was trained using scikit-learn and is stored in the **`backorder/model/backorder_best_model.pkl`** file.\n\nTo train a new prediction model, you can run the **`model.ipynb`** Jupyter Notebook in the root directory.\n\n\n## Credits\n\nThis project was created by [Rayyan Ahmed]( https://www.linkedin.com/in/rayyan-ahmed9477/ ).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayyan9477%2Fmachine-learning-driven-backorder-prediction-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayyan9477%2Fmachine-learning-driven-backorder-prediction-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayyan9477%2Fmachine-learning-driven-backorder-prediction-system/lists"}