Git Product home page Git Product logo

predicting-heart-disease's Introduction

Heart Disease Predictor: Project Overview

This project aims to facilitate early prediction of heart disease to aid in proactive healthcare management.

  • Utilizes Heart Failure Prediction Dataset from Kaggle.
  • Performs Exploratory Data Analysis (EDA) for initial insights.
  • Builds a robust transformation pipeline for data preparation.
  • Trains and evaluates various machine learning models using cross-validation.
  • Deploys a user-friendly API using Flask for heart disease prediction.

Note: This project was made for educational purposes.

Code and Resources

Python Version: 3.8
Packages: numpy, pandas, matplotlib, seaborn, scikit-learn, xgboost, flask, json, pickle
Setting Up Environment:

  • conda create -p venv python=3.8 -y
  • pip install -r requirements.txt

Dataset: https://www.kaggle.com/datasets/fedesoriano/heart-failure-prediction

Getting Data

The project utilizes the Heart Failure Prediction Dataset, obtained from Kaggle. This dataset boasts a unique origin, combining five previously independent heart disease datasets that share 11 common features. Following the merging process, duplicate observations were removed, resulting in a final dataset of 918 observations.

EDA

The EDA examined data distributions and value counts for categorical variables. Key insights from pivot tables are visualized in the following figures:

alt text alt text alt text alt text

Model Building

  • Split the data into train and test sets with a test size of 20%
  • Constructed a data transformation pipeline that encodes categorical features and standardizes numerical features.
  • Leveraging cross-validation, we evaluated multiple models to predict heart disease, prioritizing both accuracy and training efficiency. Ultimately, the Random Forest model emerged as the optimal choice due to its superior performance.
  • Fine-tune the Random Forest model to achieve optimal performance.

The results of cross-validation for the models are as follows:

alt text

Productionization

Deployed a user-friendly API using Flask. The API endpoint accepts user requests and returns the predicted heart disease classification.

alt text

predicting-heart-disease's People

Contributors

polaternez avatar

Watchers

 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.