Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Heart Disease Prediction Using Machine Learning Classification Models

A machine learning project focused on the early and accurate prediction of heart disease using clinical and medical parameters.

By leveraging features like age, cholesterol levels, and ECG results, this project aims to replace traditional, time-consuming diagnostic methods with efficient and interpretable classification models.


Objective

  • Develop a robust ML framework for heart disease prediction
  • Compare multiple classification algorithms to identify the best-performing model
  • Enable early detection using standard medical diagnostic parameters

Features

Exploratory Data Analysis

  • Statistical summary of medical features
  • Distribution plots for key parameters (age, cholesterol, blood pressure, etc.)
  • Correlation analysis between features and heart disease outcome

Data Preprocessing

  • Handling missing values and duplicate records
  • Feature scaling and normalization
  • Label encoding for categorical variables
  • Train-test split for unbiased evaluation

Classification Models

  • Logistic Regression
  • Decision Tree
  • Random Forest
  • K-Nearest Neighbors (KNN)
  • Support Vector Machine (SVM)

Model Evaluation

  • Accuracy, Precision, Recall, F1-Score
  • Confusion Matrix visualization
  • ROC-AUC curve comparison across models

Feature Importance

  • Identifying the most significant clinical predictors
  • Model interpretability for medical use cases

Tech Stack

Language

  • Python

Libraries

  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Scikit-learn

Environment

  • Jupyter Notebook

Project Structure

Heart-Disease-Prediction-Using-Machine-Learning-Classification-Models/
│
├── main.ipynb        # Full analysis notebook (EDA + model training + evaluation)
└── README.md

Getting Started

Prerequisites

pip install pandas numpy matplotlib seaborn scikit-learn

Run the Notebook

jupyter notebook main.ipynb

Dataset Features

Feature Description
Age Age of the patient
Sex Gender (1 = male, 0 = female)
cp Chest pain type (0–3)
trestbps Resting blood pressure (mm Hg)
chol Serum cholesterol (mg/dl)
fbs Fasting blood sugar > 120 mg/dl
restecg Resting ECG results (0–2)
thalach Maximum heart rate achieved
exang Exercise-induced angina
oldpeak ST depression induced by exercise
target Heart disease present (1) or absent (0)

Future Improvements

  • Hyperparameter tuning using GridSearchCV / RandomizedSearchCV
  • Add deep learning models (Neural Networks)
  • Deploy as a web app using Flask or Streamlit
  • Integrate with patient health records for real-world usage
  • Explainability using SHAP values

License

MIT License

About

This project focuses on developing a machine learning framework for the early and accurate prediction of heart disease. By leveraging medical parameters like age, cholesterol, and ECG results, the project aims to replace traditional, time-consuming diagnostic methods with efficient classification models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages