Skip to content

SleepyMiner/Heart-Attack-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

Heart Attack Prediction

This repository contains a Jupyter notebook for predicting heart attacks using machine learning models. The dataset used in this project includes various health metrics and indicators to help predict the likelihood of a heart attack.

Dataset

The dataset used in this project is Dataset Heart Disease.csv. It contains the following columns:

  • age: Age of the patient
  • sex: Gender of the patient (1 = male, 0 = female)
  • chest pain type: Type of chest pain experienced
  • resting bps: Resting blood pressure
  • cholesterol: Cholesterol level
  • fasting blood sugar: Fasting blood sugar level (1 = true, 0 = false)
  • resting ecg: Resting electrocardiographic results
  • max heart rate: Maximum heart rate achieved
  • exercise angina: Exercise-induced angina (1 = yes, 0 = no)
  • oldpeak: ST depression induced by exercise relative to rest
  • ST slope: Slope of the peak exercise ST segment
  • target: Heart disease (1 = yes, 0 = no)

Correlation Heatmap

correlation-heatmap

Confusion Matrix Logistic Regression

confusion-matrix-lgr

Confusion Matrix LGBM

confusion-matrix-lgbm

Confusion Matrix XGB Classifier

confusion-matrix-xgb

Confusion Matrix Gaussian Naive Bayes

confusion-matrix-gnb

Installation

To run this project, you need to install the required libraries. You can install them using pip:

pip install scikit-learn==1.5.2 pandas numpy matplotlib plotly seaborn

Usage

To use this repository, clone it and navigate to the directory:

git clone https://github.com/SleepyMiner/Heart-Attack-Prediction.git
cd Heart-Attack-Prediction

Open the Jupyter notebook:

jupyter notebook HeartAttackPrediction.ipynb