Git Product home page Git Product logo

heart_disease_prediction's Introduction

Heart Disease Prediction

Problem description

The goal is to predict the binary class heart_disease_present, which represents whether or not a patient has heart disease:

  • 0 represents no heart disease present
  • 1 represents heart disease present

Introduction

The heart disease prediction file creates a supervised prediction model to predict whether the patient is having heart disease or not.

The dataset obtained was in the form of two separate CSV files, one contained the features and the other the target.

The outliers are eliminated using the Interquartile range.

The categorical features are encoded using the pandas get_dummies() function.

The correlation among the features is visualized using the heatmap, while the correlation between the features and the target variable is plotted using a bar graph.

The dataset is split into training and testing data using 'train_test_split' in a 70:30 ratio.

Column Transformer is used to scale the numerical variables for the efficient performance of our model.

Since we saw an imbalance in the target classes, we can apply smote to balance using the oversampling technique.

The features are selected using the SelectFrom Model where the features with high feature importance are selected and separated as a new training and testing dataset.

Three models are trained and tested against the data in our hand,

  • Logistic Regression
  • KNN
  • Random Forest

After carefully evaluating and taking all the metrics into consideration the KNN algorithm was giving the best result.

Hyperparameter tuning was done but did not result in the improvement of the performance of the algorithm.

heart_disease_prediction's People

Contributors

thamannahafeez avatar

Watchers

 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.