Skip to content

The goal of this project is to predict weather or not someone has heart disease based on their medical attributes via machine learning models

Notifications You must be signed in to change notification settings

YaSuei88/Machine_Learing_Heart_Disease_Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Machine_Learing_Heart_Disease_Classification - Project Overview

This is my learning project when taking Machine Learning 0-Master course on Udemy. The goal of this project is to predict weather or not someone has heart disease based on their medical attributes via Logestic Regression, KNN Classifier and Random Forest Classifier machine learning models.

1. Problem definition

Give clinical statement of a patient, can we predict weather or not they have heart disease?

2. Data

The original data came from Cleavland data from Machine Learning Repository. https://archive.ics.uci.edu/ml/datasets/heart+disease

There is also a version available on Kaggle: https://www.kaggle.com/ronitf/heart-disease-uci?select=heart.csv

3. Code and Resource Used

Python version: 3.7 Packages: pandas, numpy, matplotlib, seaborn, sklearn

4. EDA

I looked into the medical attributes: what are they, any possible corrlation to the heart dieases. Here are some examples:

image

Heart disease frequency according to sex

image

Max heart rate and heart disease

image

Heart disease frequency per chest pain type

image correlation matrix of medical atributes

5. Data processing

There is no need to preprocess the data for this project, the data set is already processed.

6. Modelling and evaluation

6.1 Modelling and primary evaluation

  • Split the data into train and test set.
  • Write a function to loop through Logisitc Regression, KNeighbors Classifier, and Random Forest Classifier
  • Compared the accuracies from three models.

image

  • Hyperparameter tuning 3 models: n_neighbors for KNN model, RandomSearchCV for Logisitic and Random Forest, and GridSearchCV for Logistic.

image

Result after fine tuning KNN

6.2 Evaluating our tuned machine learning classifier, beyond accuracy (use Logistic as a model example)

  • ROC curve and AUC score

image

  • Confusion matrix

image

  • Classification report
  • Precision
  • Recall
  • F1-score

image

6.3 Feature importnce (Logistic Regressor)

image

About

The goal of this project is to predict weather or not someone has heart disease based on their medical attributes via machine learning models

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published