Five classifiers compared on the 13-feature clinical heart dataset, with the strongest packaged as a Flask app that scores risk from a form.
Result: Random Forest was the strongest at ~82% accuracy; a majority-vote ensemble landed just behind at ~82%. Stack: Python, scikit-learn, Flask, pandas, matplotlib/seaborn Live case study: https://pranavkaja.vercel.app/projects/heart-disease-prediction
Predict heart-disease risk from 13 standard clinical inputs, and make it usable, not just a number in a notebook.
- Compared five classifiers on the same train/test split: Random Forest, KNN, SVM, Decision Tree, and Logistic Regression.
- For each, also ran Bagging and AdaBoost variants to see whether ensembling moved the needle.
- Combined the strongest base models by majority vote.
- Served the result as a Flask app that scores risk from a 13-field form.
From the notebook (HeartDiseasePrediction.ipynb), on a 25% held-out test set:
| Model | Accuracy |
|---|---|
| Random Forest | 82.2% |
| Majority-vote ensemble | 81.9% |
| KNN | 75.7% |
| SVM | 73.9% |
| Decision Tree | 73.0% |
| Logistic Regression | 70.1% |
Random Forest was the most reliable single model. Bagging and AdaBoost variants didn't beat it, and a majority-vote ensemble (Random Forest + Decision Tree + KNN) tracked it closely. The deployed Flask app uses that three-model majority vote.
git clone https://github.com/PranavKaja/heart-disease.git
cd heart-disease
pip install -r requirements.txt
python train.py # trains the models and writes the .pkl files
python app.py # then open http://localhost:5000The full comparison, plots, and analysis live in HeartDiseasePrediction.ipynb.
Public UCI-style heart dataset (Heart.csv), 13 clinical features, no private patient data. The target column is AHD. The .pkl model files are generated by train.py, so they aren't checked in.
Part of my portfolio. Built by Pranav Kaja.