This is a simple yet powerful heart disease risk prediction system built using Python, Scikit-learn, and Flask. The app predicts a numerical risk score for heart disease based on patient lifestyle and medical history.
The main objective of this project is to provide a basic regression-based heart risk prediction using machine learning. The model is trained using real-world health-related features, allowing users to estimate their risk level based on individual inputs.
- Sex (male/female)
- Age
- Total Cholesterol (TC)
- HDL Cholesterol (HDL)
- Smoking status (smoking / no smoking)
- Blood Pressure Medication (yes / no)
- Diabetes (yes / no)
- Preprocessing:
- Handling missing values
- Feature scaling
- Categorical encoding
- Model: GradientBoostingRegressor
- Validation: Cross-validation & Hyperparameter tuning using GridSearchCV
A simple UI that allows users to:
- Input personal and medical data
- Get a real-time heart disease risk score
- Visualize prediction instantly
Currently hosted locally via Flask.
-
Clone the repository:
git clone https://github.com/dmisasanka2002/Heart-Risk-Prediction.git cd Heart-Risk-Prediction -
Install dependencies:
pip install -r requirements.txt
-
Run the app locally:
python app/main.py
📦Heart Risk Prediction
┣ 📂app/ # Flask application
┣ 📂data/ # Data and data models
┣ 📂models/ # ML pipeline and saved model
┣ 📂notebooks/
┣ 📜README.md
┗ 📜requirements.txt