Coronary Heart Disease Prediction using Machine Learning Algorithms

Job ID: 39350370

Budget: ₹750 – ₹1,250 INR

Project Title: Coronary Heart Disease Prediction using
Machine Learning Algorithms
Objective:
Build a machine learning classification model to predict coronary heart disease over a 10-year period.

Dataset:

Source: Data_cardiovascular_risk.csv

3390 records with 17 columns (after cleaning: 3004 records and 16 features).

Data Preprocessing:

Handled missing values by dropping rows with missing data.

Encoded categorical variables (sex, is_smoking).

Dropped 'education' feature as it was not relevant.

Exploratory Data Analysis:

Correlation matrix plotted to identify feature relationships.

Countplots and boxplots were created based on the target variable (TenYearCHD).

Key observations:

Systolic and diastolic blood pressure are strongly correlated.

Smokers aged ~50 have higher CHD risk.

Diabetic patients with high glucose levels are at higher risk.

Older non-smokers (65–70 years) also show risk.

Model Building:
Algorithms used:

Logistic Regression

k-Nearest Neighbours (KNN)

Decision Trees

Support Vector Machine (SVM)

Random Forest

Naive Bayes

Training & Testing Split:

60% training, 40% testing split.

Highly imbalanced classes (CHD No : Yes ≈ 5.6 : 1).

Model Evaluation Metrics:

Accuracy

F1 Score

Precision

Recall

Performance Summary:


Model Accuracy (%) F1 Score (%) Precision (%) Recall (%)
Logistic Regression 84.4 2.1 33.3 1.09
KNN 83.6 6.6 26.9 3.8
Decision Tree 73.3 22.3 20.2 24.9
SVM 84.6 0.0 0.0 0.0
Random Forest 84.3 7.8 40.0 4.3
Naive Bayes 81.8 29.09 36.3 24.3
Best Performing Model:

Logistic Regression achieved the highest accuracy (84.4%).

Though precision was decent (33.3%), recall and F1 scores were low due to class imbalance.

Validation:

Confusion matrix and ROC-AUC curve plotted for Logistic Regression.

ROC-AUC score for Logistic Regression: 50.3%.

Final Conclusions:

Age, cigarette consumption, systolic blood pressure, and glucose levels are critical features.

Patients with high systolic BP, high glucose levels, smoking habits, and strokes are more vulnerable to CHD.

Logistic Regression is recommended despite limitations due to better stability and performance.