{"id":28368845,"url":"https://github.com/romilagarwal/heart-failure-prediction","last_synced_at":"2026-05-04T23:40:05.758Z","repository":{"id":287286235,"uuid":"928523837","full_name":"Romilagarwal/heart-failure-prediction","owner":"Romilagarwal","description":"🫀 Machine learning system for early heart disease risk prediction using XGBoost. Features interactive Streamlit dashboard, Flask API, and Docker support. Try the live demo!","archived":false,"fork":false,"pushed_at":"2025-04-10T23:28:43.000Z","size":5901,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T06:53:39.849Z","etag":null,"topics":["docker","healthcare","heart-disease","maching-learning","restful-api","streamlit","xgboost-classifier"],"latest_commit_sha":null,"homepage":"https://heart-failure-prediction-by-romil.streamlit.app/","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/Romilagarwal.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,"zenodo":null}},"created_at":"2025-02-06T19:14:01.000Z","updated_at":"2025-04-10T23:28:46.000Z","dependencies_parsed_at":"2025-04-10T23:30:12.830Z","dependency_job_id":"a0d07cec-29f8-4451-b0b7-ba3bda99f605","html_url":"https://github.com/Romilagarwal/heart-failure-prediction","commit_stats":null,"previous_names":["romilagarwal/heart-failure-prediction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Romilagarwal/heart-failure-prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romilagarwal%2Fheart-failure-prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romilagarwal%2Fheart-failure-prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romilagarwal%2Fheart-failure-prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romilagarwal%2Fheart-failure-prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Romilagarwal","download_url":"https://codeload.github.com/Romilagarwal/heart-failure-prediction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romilagarwal%2Fheart-failure-prediction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261029390,"owners_count":23099745,"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":["docker","healthcare","heart-disease","maching-learning","restful-api","streamlit","xgboost-classifier"],"created_at":"2025-05-29T05:08:18.338Z","updated_at":"2026-05-04T23:40:05.753Z","avatar_url":"https://github.com/Romilagarwal.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🫀 Heart Failure Prediction\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python](https://img.shields.io/badge/Python-3.7+-blue?logo=python\u0026logoColor=white)](https://www.python.org/)\n[![Streamlit](https://img.shields.io/badge/Streamlit-App-FF4B4B?logo=streamlit\u0026logoColor=white)](https://heart-vs.streamlit.app/)\n[![Docker](https://img.shields.io/badge/Docker-Available-2496ED?logo=docker\u0026logoColor=white)](https://www.docker.com/)\n[![XGBoost](https://img.shields.io/badge/XGBoost-Model-026F00?logo=xgboost\u0026logoColor=white)](https://xgboost.readthedocs.io/)\n[![Flask](https://img.shields.io/badge/Flask-API-000000?logo=flask\u0026logoColor=white)](https://flask.palletsprojects.com/)\n\n\u003e **Live Demo**: [Streamlit Cloud App](https://heart-vs.streamlit.app/) | **Repository**: [GitHub](https://github.com/Romilagarwal/heart-failure-prediction)\n\n## 📊 Project Overview\n\nCardiovascular diseases remain the **#1 cause of death globally**, claiming an estimated 17.9 million lives each year. Early detection and management are critical for people at high risk.\n\nThis machine learning system predicts heart disease risk based on clinical parameters, helping healthcare professionals identify at-risk patients earlier and potentially save lives through timely intervention.\n\n## ✨ Key Features\n\n- **High-accuracy prediction**: XGBoost classifier with fine-tuned parameters\n- **Multiple deployment options**: Web application, API, and containerized solution\n- **Interactive interface**: User-friendly Streamlit dashboard for instant predictions\n- **RESTful API**: Flask backend for seamless integration with other systems\n- **Docker support**: Ready for deployment in any environment\n- **Cloud-deployed**: Accessible anywhere via Streamlit Cloud\n\n## 📈 Dataset \u0026 Analysis\n\nThe model is trained on the [Heart Failure Prediction Dataset](https://www.kaggle.com/datasets/fedesoriano/heart-failure-prediction/) from Kaggle, containing key cardiovascular health indicators:\n\n- Demographic details (age, sex)\n- Clinical parameters (blood pressure, cholesterol levels)\n- Symptoms (chest pain type, exercise-induced angina)\n- Test results (resting ECG, max heart rate, ST depression)\n\nOur extensive [exploratory data analysis](https://github.com/Romilagarwal/heart-failure-prediction/blob/main/notebook/part_1_preprocessing.ipynb) reveals critical patterns between these variables and heart disease risk.\n\n## 🧠 Model Development\n\nThe project evaluates multiple classification algorithms:\n- Logistic Regression\n- Decision Tree Classifier\n- Random Forest Classifier\n- XGBoost Classifier\n\nAfter rigorous comparison using confusion matrices and AUC scoring, **XGBoost** emerged as the top performer. The [complete modeling process](https://github.com/Romilagarwal/heart-failure-prediction/blob/main/notebook/part_2_modeling.ipynb) includes feature importance analysis and hyperparameter tuning.\n\n## 🚀 Deployment Options\n\n### 1️⃣ Streamlit Web App\n```bash\nstreamlit run heart_disease_prediction.py\n```\nAccess a user-friendly interface to input patient data and receive instant predictions.\n\n### 2️⃣ Flask API\n```bash\npython predict_flask.py\n```\nFor programmatic access or integration with existing healthcare systems.\n\n### 3️⃣ Docker Container\n```bash\ndocker build -t heart-prediction-app .\ndocker run -it -p 9696:9696 --rm --name heart_app heart-prediction-app:latest\n```\nDeploy anywhere with consistent environment and dependencies.\n\n## 🛠️ Setup \u0026 Installation\n\n### Prerequisites\n- Python 3.7+\n- pip package manager\n\n### Quick Start\n```bash\n# Clone repository\ngit clone https://github.com/Romilagarwal/heart-failure-prediction.git\ncd heart-failure-prediction\n\n# Set up virtual environment\npip install pipenv\npipenv install\npipenv shell\n\n# Run the app\nstreamlit run heart_disease_prediction.py\n```\n\n### Testing the API\n```bash\npython predict_flask_test.py\n```\n\nExample output:\n```\n{'hasHeartDisease': True, 'hasHeartDisease_probability': 0.73}\nPotentially at risk of heart disease. Follow-up examination recommended.\n```\n\n## 📚 Additional Resources\n\n- [Model training script](https://github.com/Romilagarwal/heart-failure-prediction/blob/main/training.py)\n- [Docker installation guide](https://docs.docker.com/engine/install/)\n- [Streamlit Cloud deployment](https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app)\n\n## ⚠️ Disclaimer\n\nThis tool is designed for **screening purposes only** and should not replace professional medical advice. Always consult healthcare providers for proper diagnosis.\n\n## 🤝 Contributing\n\nContributions to improve the model accuracy, user interface, or add new features are welcome. Please feel free to submit a pull request.\n\n## 📄 License\n\nThis project is available under the MIT License.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003ci\u003eBuilding healthier futures through machine learning and predictive analytics.\u003c/i\u003e\n\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromilagarwal%2Fheart-failure-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromilagarwal%2Fheart-failure-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromilagarwal%2Fheart-failure-prediction/lists"}