Git Product home page Git Product logo

heart-disease-prediction's Introduction

Heart Disease Prediction

This repository contains code and resources for predicting heart disease using machine learning and deep learning techniques. The project utilizes the Cleveland Heart Disease dataset and the Statlog (Heart) dataset to train and evaluate models for predicting the presence of heart disease.

Table of Contents

Introduction

Heart disease is one of the leading causes of death globally. Early detection and prevention are crucial in reducing mortality rates. This project aims to develop a predictive model using machine learning and deep learning techniques to identify individuals at risk of heart disease.

Datasets

Cleveland Heart Disease Dataset

The Cleveland dataset is a well-known dataset for heart disease prediction and contains 303 instances with 14 attributes, including age, sex, chest pain type, resting blood pressure, serum cholesterol, fasting blood sugar, resting ECG results, maximum heart rate achieved, exercise-induced angina, oldpeak, the slope of the peak exercise ST segment, number of major vessels colored by fluoroscopy, thalassemia, and the presence of heart disease (target).

Statlog (Heart) Dataset

The Statlog dataset contains 270 instances with the same attributes as the Cleveland dataset, making it suitable for combining and cross-validation.

Installation

To run the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/satyacasm/Heart-Disease-Prediction.git
    cd Heart-Disease-Prediction
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install the required packages:

    pip install -r requirements.txt

Usage

  1. Ensure you have the datasets (Heart_disease_cleveland_new.csv and heart.dat) in the project directory.

  2. Run the script to train and evaluate the models:

    python main.py
  3. The results will be saved in the model_results.csv file.

Model

The project includes the following steps:

  1. Data Preprocessing: Load and preprocess the Cleveland and Statlog datasets.
  2. Feature Scaling: Normalize the feature values using StandardScaler.
  3. Model Training: Train a neural network using the Jellyfish Optimization Algorithm to find the best hyperparameters.
  4. Model Evaluation: Evaluate the model on a test set using metrics such as accuracy, precision, recall, F1 score, and ROC AUC score.

Results

The results of the model, including accuracy, precision, recall, F1 score, and ROC AUC score, are saved in the model_results.csv file.

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add your message here').
  5. Push to the branch (git push origin feature/your-feature-name).
  6. Create a new Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

heart-disease-prediction's People

Contributors

yashssingh avatar satyacasm avatar sarveshsinghgr8 avatar

Watchers

 avatar

Forkers

yashssingh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.