Skip to content

anushka-2208/Heart-Attack-Prediction-Using-Different-ML-Models

Repository files navigation

Heart-Attack-Prediction-Using-Different-ML-Models

Heart Attack Prediction Using Different ML Models This repository contains code for predicting the likelihood of a heart attack using various machine learning models. The dataset used contains several features related to heart health, such as age, sex, cholesterol levels, and more.

Instructions To use this code, follow these steps:

Clone the repository to your local machine using the following command: bash git clone https://github.com/anushka-2208/heart-attack-prediction.git

Navigate to the project directory: cd heart-attack-prediction

Install the required Python libraries: pip install -r requirements.txt Run the Jupyter notebook Heart_Attack_Prediction.ipynb to see the code and results.

Dataset

The dataset used in this project (heart.csv) contains the following attributes:

age sex chest pain type (4 values) resting blood pressure serum cholesterol in mg/dl fasting blood sugar > 120 mg/dl resting electrocardiographic results (values 0, 1, 2) maximum heart rate achieved exercise-induced angina oldpeak = ST depression induced by exercise relative to rest the slope of the peak exercise ST segment number of major vessels (0-3) colored by fluoroscopy thal: 0 = normal; 1 = fixed defect; 2 = reversible defect target: 0 = less chance of heart attack, 1 = more chance of heart attack

Overview

The Jupyter notebook provides detailed analysis and model building steps. Here's a brief overview of what's covered:

Data exploration and visualization. Data preprocessing, including handling missing values and scaling features. Building and evaluating various machine learning models: Logistic Regression Gaussian Naive Bayes Random Forest Extreme Gradient Boost Decision Tree Support Vector Machine K-Nearest Neighbors Identifying the importance of each feature. Ensemble learning using the stacking technique. ROC Curve analysis. Model evaluation and comparison. Visualizations of model performance. For more details, please refer to the Jupyter notebook.

Contributors

Anushka Sharma

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages