This project aims to predict the presence of heart disease in a patient based on their medical attributes using various machine learning models. The best-performing model is deployed using a simple UI powered by Streamlit.
Heart disease is one of the leading causes of death globally. Early detection can save lives. This project leverages machine learning to predict the likelihood of heart disease based on patient health metrics.
The workflow includes:
- Exploratory Data Analysis (EDA)
- Feature scaling
- Training multiple ML models
- Model evaluation and selection
- Deployment using Streamlit
To build and deploy a machine learning model that can accurately predict whether a patient is likely to have heart disease based on clinical and personal attributes.
Dataβββ heart.csv #DatasetNotebooksβββ Heart_Disease_JupyterNotebook.ipynb #Combined EDA + Model training + Predictiondocsβββ Heart_Disease_Prediction.pdfCombined #Documentationmodelsβββ heart_model.pkl #Trained Model(SVM)srcβββ app.py #Streamlit UI for PredictionsREADME.md- #Project Descriptionrequirements.txt- #Required Python Packages
- Source: UCI Machine Learning Repository
- Filename:
heart.csv - Features:
- Age, Sex, Chest Pain Type, Resting BP, Cholesterol, Fasting Blood Sugar, Rest ECG, Max Heart Rate, Exercise Angina, Oldpeak, Slope, CA, Thal
- Target:
1β Heart disease present0β No heart disease
- Logistic Regression
- Random Forest Classifier
- Support Vector Machine (SVM) β (Best performing)
- Accuracy: 92.2%
- Precision: 90.83%
- Recall: 94.29%
- F1 Score: 92.52%
- ROC AUC: 97.71%
- Handling class imbalance
- Evaluating models using multiple metrics, not just accuracy
- Improving recall to reduce false negatives
- Understanding the importance of feature scaling
- Deploying ML models using Streamlit
Clone the repository:
git clone https://github.com/VaradChaudhari0210/ML_Project.git
cd heart-disease-prediction