A complete end-to-end Machine Learning project that predicts the likelihood of heart disease based on patient health parameters.
This project covers the entire ML lifecycle — from data preprocessing and feature engineering to model training, evaluation, and deployment using Flask.
Designed as a portfolio-grade data science & ML application with clean code structure and real-world workflow.
- 🧠 Cardio-Risk-Predictor using supervised machine learning
- 🧹 Missing Value Handling & Data Cleaning
- ⚖️ Class Imbalance Handling
- 🔄 Feature Transformation & Outlier Treatment
- 📊 Model Training, Evaluation & Selection
- 💾 Model & Scaler Serialization (Pickle)
- 🌐 Flask Web Application for real-time predictions
- 🎨 Simple & clean UI for user interaction
The project follows a structured and industry-standard ML workflow:
-
Data Ingestion
- Dataset loaded from
heart.csv
- Dataset loaded from
-
Data Preprocessing
- Missing value handling
- Data type correction
- Feature scaling using
StandardScaler
-
Feature Engineering
- Variable transformations
- Outlier detection & handling
-
Class Imbalance Handling
- Balancing techniques applied to improve model fairness
-
Model Training
- Multiple ML models trained and evaluated
- Best-performing model selected
-
Model Persistence
- Final model saved as
best_model.pkl - Scaler saved as
scaler.pkl
- Final model saved as
-
Model Deployment
- Flask-based web application for predictions
- Python
- Flask
- NumPy
- Pandas
- Scikit-learn
- HTML
- CSS
Cardio-Risk-Predictor/
│
├── app.py # Flask application
├── main.py # Project execution flow
│
├── heart.csv # Dataset
│
├── missing_val_handle.py # Missing value handling
├── variable_transformation_outlierhandle.py
│ # Feature transformation & outlier treatment
├── data_balance.py # Class imbalance handling
│
├── model_training.py # Model training & evaluation
├── log_code.py # Logging utilities
│
├── best_model.pkl # Trained ML model
├── scaler.pkl # Feature scaler
│
├── templates/
│ ├── index.html # Input form
│ └── result.html # Prediction result page
│
├── static/
│ └── style.css # UI styling
│
└── README.md
git clone https://github.com/amareshtoxico/Cardio-Risk-Predictor.git
cd heart-disease-prediction-mlpython -m venv venv
venv\Scripts\activate # Windowspip install flask numpy pandas scikit-learnpython app.pyhttp://127.0.0.1:5000
The model predicts heart disease based on clinical parameters such as:
- Age
- Sex
- Chest pain type
- Resting blood pressure
- Cholesterol level
- Fasting blood sugar
- Maximum heart rate achieved
- Exercise-induced angina
- ST depression and slope
(Exact inputs depend on dataset features)
- Healthcare risk prediction systems
- Medical decision support tools
- Machine Learning portfolio project
- Data science academic projects
- Flask + ML deployment reference
- Model explainability (SHAP / feature importance)
- Improved UI/UX design
- REST API support
- Cloud deployment (Render / Railway)
- User authentication & history tracking
Amaresh Virupakshi Machine Learning & Python Developer
✔ Shows real ML depth (not toy project)
✔ Clearly explains preprocessing & feature engineering
✔ Recruiter-friendly structure
✔ Demonstrates end-to-end ownership
✔ Matches actual files in your project