Giter Site home page Giter Site logo

smadwer / heart-disease-classifier Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 6 KB

This code loads a heart disease dataset from a CSV file, splits it into training and testing sets, trains a decision tree classifier on the training set, and predicts the output for the testing set. It then calculates the accuracy score of the model and prints it.

Python 100.00%

heart-disease-classifier's Introduction

Heart Disease Classifier

This project uses machine learning to predict whether or not a patient has heart disease based on their medical information. We use three different models (Decision Tree, Random Forest, and Logistic Regression) and compare their performance.

Requirements

  • Python 3.x
  • scikit-learn
  • pandas
  • matplotlib
  • numpy

Usage

  • Clone or download the repository.
  • Run the script with the command: python main.py

The script will train the models on the dataset, evaluate their performance, and display a bar plot comparing the performance of the models.

Dataset

The dataset used in this project is the Heart Disease dataset from the UCI Machine Learning Repository. It consists of medical information of patients such as age, sex, cholesterol levels, blood pressure, etc., and a target variable indicating whether or not they have heart disease (0 for no heart disease, 1 for heart disease).

Models

I used three different models:

Decision Tree Random Forest Logistic Regression Each model is trained on the dataset and evaluated using five different metrics: accuracy, precision, recall, F1-score, and ROC AUC score.

Results

The script outputs the performance of each model in terms of the five metrics and displays a bar plot comparing the performance of the models.

heart-disease-classifier's People

Contributors

smadwer avatar

Watchers

Kostas Georgiou avatar  avatar

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.