HeartGuard: Predicting Cardiovascular Risk

Using Machine Learning to Predict Heart Disease Risk from Clinical Data

Heart Disease Prediction

Project Overview

The Problem: Cardiovascular disease (CVD) is one of the leading causes of death worldwide. Early detection is vital for improving patient survival rates. However, traditional diagnostic methods can be time-consuming and imprecise, leading to delayed diagnoses and treatment.

Our Approach: The HeartGuard project uses machine learning to predict the likelihood of heart disease using clinical data such as age, cholesterol levels, blood pressure, and chest pain type. The model was trained on the UCI Heart Disease Dataset and optimized using AutoML techniques, enabling us to build an effective and scalable prediction model.

Impact: This machine learning model offers a data-driven, scalable solution for predicting cardiovascular risk. By enabling early detection, the model can improve survival rates, reduce healthcare costs, and prioritize high-risk patients for intervention.

Exploratory Data Analysis (EDA) & Key Findings

The UCI Heart Disease Dataset underwent thorough Exploratory Data Analysis (EDA). This analysis provided key insights that influenced the model’s feature engineering and final performance:

  • Age & Cholesterol: Higher age and elevated cholesterol levels showed a strong correlation with an increased likelihood of heart disease.
  • Chest Pain Type: Typical angina (chest pain) was identified as a significant risk factor for heart disease, compared to atypical or non-anginal chest pain.
  • Blood Pressure: High systolic blood pressure was a strong indicator of cardiovascular risk, highlighting the need for careful blood pressure management.
  • Exercise-Induced Angina: Patients with exercise-induced angina had a significantly higher risk of developing heart disease, demonstrating the importance of stress testing for early diagnosis.

These insights helped in refining the features used in our model, allowing us to focus on the most influential predictors of heart disease risk.

Conclusion & What We Learned

Machine Learning in Healthcare: We applied machine learning techniques to a critical healthcare problem, demonstrating the power of data science in real-world applications.

Effective Predictions: The project emphasized the importance of accurate predictions in healthcare to minimize false positives and false negatives, ensuring patients receive timely and accurate treatment.

Automated Model Selection: By using AutoML (TPOT), we automated the tedious process of model selection and hyperparameter tuning, achieving optimized models with minimal manual intervention.

Model Improvement: The effectiveness of Random Forest and TPOT AutoML in improving model performance shows the importance of exploring advanced models and optimization techniques.

Real-World Impact: The model has the potential to be integrated into clinical settings, improving patient outcomes by providing doctors with reliable, data-driven insights into cardiovascular risk.

Model Evaluation & Performance Metrics

ROC Curve

ROC Curve - Evaluating Model Performance

Model Evaluation

Model Evaluation - Classifier Performance

Confusion Matrix

Confusion matrices for each model

Model Performance Summary

Model Precision Recall F1-Score Accuracy Macro Avg Precision Macro Avg Recall Macro Avg F1-Score Weighted Avg Precision Weighted Avg Recall
Logistic Regression 0.90 0.82 0.86 0.85 0.85 0.86 0.85 0.86 0.85
Random Forest 0.87 0.92 0.92 0.92 0.92 0.92 0.92 0.92 0.92
TPOT AutoML 0.94 0.88 0.91 0.90 0.90 0.90 0.90 0.90 0.90