{"id":30663701,"url":"https://github.com/aronno1920/diabetes-prediction","last_synced_at":"2026-06-29T15:31:04.798Z","repository":{"id":310467627,"uuid":"1039850646","full_name":"Aronno1920/Diabetes-Prediction","owner":"Aronno1920","description":"Train a classification model to predict if a patient has diabetes, deploy an API using FastAPI with async, containerize it using Docker, host on Render, and build a simple frontend to take user input and display prediction.","archived":false,"fork":false,"pushed_at":"2025-08-19T11:56:26.000Z","size":436,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-31T18:07:56.409Z","etag":null,"topics":["ai","artificial-intelligence","deploy","docker","docker-compose","machine-learning","ml","render"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aronno1920.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-08-18T04:42:36.000Z","updated_at":"2025-08-19T17:51:17.000Z","dependencies_parsed_at":"2025-08-18T10:28:00.039Z","dependency_job_id":"77136668-874d-41fb-a93c-568298919462","html_url":"https://github.com/Aronno1920/Diabetes-Prediction","commit_stats":null,"previous_names":["aronno1920/diabetes-prediction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aronno1920/Diabetes-Prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aronno1920%2FDiabetes-Prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aronno1920%2FDiabetes-Prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aronno1920%2FDiabetes-Prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aronno1920%2FDiabetes-Prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aronno1920","download_url":"https://codeload.github.com/Aronno1920/Diabetes-Prediction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aronno1920%2FDiabetes-Prediction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34933498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","artificial-intelligence","deploy","docker","docker-compose","machine-learning","ml","render"],"created_at":"2025-08-31T17:54:00.933Z","updated_at":"2026-06-29T15:31:04.563Z","avatar_url":"https://github.com/Aronno1920.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Diabetes Prediction System\nA production-ready **FastAPI** based web application for predicting diabetes risk using patient health data. This project demonstrates machine learning deployment, API design and Stress testing, and modern UI integration to make healthcare predictions accessible via a simple dashboard and REST API.\n\nThe model is trained using a DecisionTree, LogisticRegression, RandomForest, SVM and KNN on the [Pima Indians Diabetes Dataset](https://www.kaggle.com/datasets/uciml/pima-indians-diabetes-database).\n\n\u003cbr/\u003e\n\n## 🚀 Quick Start\n\n➡ **Live GUI**: [Click here](https://diabetes-prediction-eggc.onrender.com) \u003cbr/\u003e\n➡ **Swagger Docs**: [Click here](https://diabetes-prediction-eggc.onrender.com/docs)\u003cbr/\u003e\n➡ **ReDoc**: [Click here](https://diabetes-prediction-eggc.onrender.com/redoc)\n\n\u003cbr/\u003e\n\n## 🌟 Features\n- **Machine Learning Model**: DecisionTree trained on Pima Indians Diabetes Dataset.\n- **RESTful API**: Clean, well-documented endpoints using FastAPI.\n- **Stress Testing**: Define user behaviour, and swarm a system with millions of simultaneous users.\n- **Type Safety**: Full Pydantic schema validation\n- **Auto Documentation**: Interactive API docs with Swagger UI, ReDoc\n- **Dockerized** for easy deployment.\n- **Live on Render** with automatic documentation.\n\n\u003cbr/\u003e\n\n## 📌 Technologies Used\n- **Backend**: FastAPI, Uvicorn\n- **Frontend**: HTML, CSS, JavaScript\n- **ML**: Scikit-learn (Pima Indians Diabetes Dataset)\n- **Testing**: Locust\n- **Deployment**: Docker, Docker Compose, Render\n\n\u003cbr/\u003e\n\n## 📂 Project Structure\n```bash\nDiabetesPrediction/\n├── app\n│ ├── static/\n│ │ ├── index.html      # User interface\n│ │ ├── styles.css      # style file\n│ │ └── app.js \n│ ├── main.py           # FastAPI entry point\n│ ├── schemas.py        # Pydantic request/response models\n│ ├── ml_model.py \n│ └── model_train.py    # Train model with Random Forest lassifier\n├── model/\n│ ├── diabetes_model.joblib # Trained ML model\n│ └── metrics.json    \n├── sample_data/\n│ └── diabetes.csv          # Sample data in csv format\n├── requirements.txt        # Python dependencies\n├── Dockerfile              # Docker image definition\n├── docker-compose.yml      # Optional docker-compose setup\n├── run_server.py           # Application entry point FastAPI and Locust both \n└── README.md               # Project documentation\n```\n\n\u003cbr/\u003e\n\n## 🛠 Installation \u0026 Local Development\n\n### 1. Prerequisites\n```bash\n- Python 3.13.7\n- pip (Python package manager)\n```\n\n### 2. Clone the repository\n```bash\ngit clone https://github.com/Aronno1920/Diabetes-Prediction.git\ncd DiabetesPrediction\n```\n### 3. Create and activate a virtual environment\n```bash\n# On Windows PowerShell\npython -m venv venv\n# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\nvenv\\Scripts\\activate\n\n# On Linux/Mac\npython -m venv env\nsource env/bin/activate\n```\n### 4. Install dependencies\n```bash\npip install -r requirements.txt\n```\n### 5. Train the model (if not already trained)\n```bash\n# For training model and build joblib\npython model_train.py\n```\n### 6. Run the API and Locust locally\n```bash\npython run_server.py\n\n-------\nAPI will be available at:\nAPI ➡ http://localhost:8000\nSwagger Docs ➡ http://localhost:8000/docs\nReDoc ➡ http://localhost:8000/redoc\n\n-------\nLocust will be available at:\nReDoc ➡ http://localhost:8089\n```\n\n\u003cbr/\u003e\n\n## 📖 API Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/health` | Health check endpoint |\n| GET | `/info` | Model information |\n| GET | `/metrics` | Best model and algorithm AOC |\n| POST | `/predict` | Predict Diabetes Prediction |\n\n\u003cbr/\u003e\n\n## 🌐 Deployed API\n```bash\nLive Endpoint:\nBase URL: https://diabetes-prediction-eggc.onrender.com\n```\nRequest Body:\n```bash\n{\n  \"Pregnancies\": 1,\n  \"Glucose\": 85,\n  \"BloodPressure\": 66,\n  \"SkinThickness\": 29,\n  \"Insulin\": 0,\n  \"BMI\": 26.6,\n  \"DiabetesPedigreeFunction\": 0.351,\n  \"Age\": 31\n}\n```\nResponse:\n```bash\n{\n  \"prediction\": 0,\n  \"result\": \"Not Diabetic\",\n  \"confidence\": 1\n}\n```\n\n\u003cbr/\u003e\n\n## 🚦 Stress Testing with Locust\n\u003col\u003e\n  \u003cli\u003eVisit: http://localhost:8089\u003c/li\u003e\n  \u003cli\u003eEnter:\n    \u003cul\u003e\n      \u003cli\u003eHost → http://localhost:8000\u003c/li\u003e\n      \u003cli\u003eUsers → Number of simulated users\u003c/li\u003e\n      \u003cli\u003eSpawn rate → Requests per second\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/li\u003e\n  \u003cli\u003eRun the test and analyze live metrics.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cbr/\u003e\n\n## 📸 Screenshots\n![API Performance Comparison](screenshot/Screenshot_1.png)\n*Screenshot of User Interface - Diabetes Prediction System*\n![API Performance Comparison](screenshot/Screenshot_2.png)\n*Screenshot of Not Diabatic - Prediction result of System*\n\n\u003cbr/\u003e\n\n---\n\n**Author**: [Selim Ahmed](https://github.com/aronno1920)  \n**Project**: Diabetes Prediction System (FastAPI/GUI)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faronno1920%2Fdiabetes-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faronno1920%2Fdiabetes-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faronno1920%2Fdiabetes-prediction/lists"}