Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ansh420/heart-attack-prediction

Predicting whether a patient has 10-year risk of developing coronary heart disease(CHD) using different Machine Learning techniques.
https://github.com/ansh420/heart-attack-prediction

gui machine-learning prediction

Last synced: 19 days ago
JSON representation

Predicting whether a patient has 10-year risk of developing coronary heart disease(CHD) using different Machine Learning techniques.

Awesome Lists containing this project

README

        

![heart_disease_prediction_logo2_](https://github.com/user-attachments/assets/d616f6d6-ad33-4848-9114-60a0772dd6ca)

# Heart-attack-prediction

The silver lining is that heart attacks are highly preventable and simple lifestyle modifications(such as reducing alcohol and tobacco use; eating healthily and exercising) coupled with early treatment greatly improves its prognosis. It is, however, difficult to identify high risk patients because of the multi-factorial nature of several contributory risk factors such as diabetes, high blood pressure, high cholesterol, et cetera. This is where machine learning and data mining come to the rescue.

Doctors and scientists alike have turned to machine learning (ML) techniques to develop screening tools and this is because of their superiority in pattern recognition and classification as compared to other traditional statistical approaches.

I will be giving you a walk through on the development of a screening tool for predicting whether a patient has 10-year risk of developing **coronary heart disease(CHD)** using different Machine Learning techniques.
## Prerequisites

Before you can run the code, ensure you have the following installed:

- Python 3.6 or later.
- NumPy.
- pandas.
- scikit-learn.
- matplotlib.
- seaborn.

![1-s2 0-S0010482521004662-gr1](https://github.com/user-attachments/assets/4f435770-687e-4c27-a481-d43855d58610)

## Dataset
The dataset used for training and evaluation is assumed to be in a CSV format. It should contain the following columns:

- **age**: Age of the patient

- **sex**: 1 for male, 0 for female

- **cp**: Chest pain type (1-4)

- **trestbps**: Resting blood pressure

- **chol**: Serum cholesterol

- **fbs**: Fasting blood sugar (1 if > 120 mg/dl, 0 otherwise)

- **restecg**: Resting electrocardiographic results (0, 1, 2)

- **thalach**: Maximum heart rate achieved

- **exang**: Exercise-induced angina (1: yes, 0: no)

- **oldpeak**: ST depression induced by exercise

- **slope**: Slope of the ST segment (0, 1, 2)

- **ca**: Number of major vessels colored by fluoroscopy

- **thal**: Thallium stress test result (0, 1, 2, 3)

- **target**: 1 for heart attack, 0 for no heart attack

## Usage
Clone the Repository:

$ Bash

$ git clone **https://github.com/Ansh420/heart-attack-prediction.git**

## Install Dependencies:

$ pip install **-r requirements.txt**

## Prepare the Data:

Place your dataset in a CSV file named **heart.csv**.

- Train the Model:

$ python **train.py**

This script will load the dataset, preprocess it, and train a machine learning model.

## Model Architecture
The specific machine learning algorithm used can be customized by modifying the **train.py** script. Possible options include:

- Logistic Regression
- Decision Trees
- Random Forests
- Support Vector Machines

![1__sp4c5RUZsAY3i5PqAN4pw](https://github.com/user-attachments/assets/9e4fb1bc-820f-4c5e-8b39-9ba2ef702e76)