Heart Disease Prediction
🤖

Heart Disease Prediction

Date
Oct 16, 2023
Tags
Machine Learning
Data Science
Jupyter Notebook
Python
sk-learn

Description

This is a classification supervised learning project to predict heart disease based on the data provided. It is one of the projects from The Complete Machine Learning and Data Science Bootcamp. The focus of this project is to use various Python-based machine learning and data science libraries in an attempt to build a machine learning model capable of predicting whether or not someone has heart disease based on their medical attributes.

Framework

  1. Problem definition
  1. Data
  1. Evaluation
  1. Features
  1. Modelling
  1. Experimentation

Research Question

Given clinical parameters about a patient, can we predict whether or not they have heart disease?

Data Sources

Features

  1. age - age in years
  1. sex - (1 = male; 0 = female)
  1. cp - chest pain type
      • 0: Typical angina: chest pain related decrease blood supply to the heart
      • 1: Atypical angina: chest pain not related to heart
      • 2: Non-anginal pain: typically esophageal spasms (non heart related)
      • 3: Asymptomatic: chest pain not showing signs of disease
  1. trestbps - resting blood pressure (in mm Hg on admission to the hospital)
      • anything above 130-140 is typically cause for concern
  1. chol - serum cholestoral in mg/dl
      • serum = LDL + HDL + .2 * triglycerides
      • above 200 is cause for concern
  1. fbs - (fasting blood sugar > 120 mg/dl) (1 = true; 0 = false)
      • '>126' mg/dL signals diabetes
  1. restecg - resting electrocardiographic results
      • 0: Nothing to note
      • 1: ST-T Wave abnormality
        • can range from mild symptoms to severe problems
        • signals non-normal heart beat
      • 2: Possible or definite left ventricular hypertrophy
        • Enlarged heart's main pumping chamber
  1. thalach - maximum heart rate achieved
  1. exang - exercise induced angina (1 = yes; 0 = no)
  1. oldpeak - ST depression induced by exercise relative to rest
      • looks at stress of heart during excercise
      • unhealthy heart will stress more
  1. slope - the slope of the peak exercise ST segment
      • 0: Upsloping: better heart rate with excercise (uncommon)
      • Flatsloping: minimal change (typical healthy heart)2: Downslopins: signs of unhealthy heart
  1. ca - number of major vessels (0-3) colored by flourosopy
      • colored vessel means the doctor can see the blood passing through
      • the more blood movement the better (no clots)
  1. thal - thalium stress result
      • 1,3: normal
      • 6: fixed defect: used to be defect but ok now
      • 7: reversable defect: no proper blood movement when excercising
  1. target - have disease or not (1=yes, 0=no) (= the predicted attribute)
 

Conclusion

The accuracy of the machine learning model is less than the defined evaluation metric, 95% accuracy. Since this is a proof of concept, this project may or may not be pursued based on the results. The next steps would be to collect more data, try alternative models, or improve the current models.
 

👋🏻 Let’s chat!

If you are interested in working with me, have a project in mind, or just want to say hello, please don't hesitate to contact me.

Find me here 👇🏻

notion image
Please do not steal my work. It took uncountable cups of coffee and sleepless nights. Thank you.