A Streamlit web app that estimates heart disease risk from 13 patient vitals and test results, using a Random Forest Classifier trained on a Kaggle heart disease dataset.
| File | Purpose |
|---|---|
Machine_Learning_-_Random_Forest_Classifier_-_Heart_Disease.ipynb |
Original Colab notebook: data loading, EDA, train/test split, Random Forest training, evaluation, and model export via joblib. |
heart_disease_model.joblib |
The trained model, exported from the notebook. |
app.py |
Streamlit frontend that loads the model and serves live predictions. |
requirements.txt |
Python dependencies. |
pip install -r requirements.txt
streamlit run app.pyThe app is styled as a "cardiac monitor" dashboard: a live ECG waveform in the header idles calmly, then reflects the prediction result \u2014 a steady green trace for low risk, a fast red trace for elevated risk. Inputs are grouped into clinical sections (Demographics, Vitals & Labs, Cardiac Tests) rather than a flat form, and results include the model's confidence percentage plus a feature importance breakdown.
All 13 input features were already numerically encoded in the source
dataset (no separate encoder was fit during training), so app.py maps
human-readable dropdown options directly to the same integer codes seen
during training. The exact meaning of a couple of coded fields (e.g.
Thallium Stress Test Result) follows the most common convention for this
dataset \u2014 worth double-checking against your own data dictionary if
exact category labels matter for grading.
This tool is an educational project and is not medical advice.