Coder Social home page Coder Social logo

heart-disease-prediction's Introduction

Heart Disease Prediction Project

Heart Disease Prediction using Logistic Regression

Problem:

World Health Organization has estimated 12 million deaths occur worldwide, every year due to Heart diseases. Half the deaths in the United States and other developed countries are due to cardio vascular diseases. The early prognosis of cardiovascular diseases can aid in making decisions on lifestyle changes in high risk patients and in turn reduce the complications. This research intends to pinpoint the most relevant/risk factors of heart disease as well as predict the overall risk using logistic regression.

Solution:

The classification goal is to predict whether the patient has 10-year risk of future coronary heart disease (CHD).

I have implemented Logistic Regression Model to predict Coronary Heart Disease.

What is Logistic Regression ?

Logistic Regression is a statistical and machine-learning techniques classifying records of a dataset based on the values of the input fields . It predicts a dependent variable based on one or more set of independent variables to predict outcomes . It can be used both for binary classification and multi-class classification.


Data info:

The dataset is available on the Kaggle website, and it is from an ongoing cardiovascular study on residents of the town of Framingham, Massachusetts. The dataset provides the patients’ information. It includes over 4,000 records and 15 attributes.

The dataset is already provided in the repository (here).

Framingham Heart study dataset includes several demographic risk factors:-

  1. sex: male or female
  2. age: age of the patient
  3. education: levels coded 1 for some high school, 2 for a high school diploma or GED, 3 for some college or vocational school, and 4 for a college degree.

The data set also includes behavioral risk factors associated with smoking

  1. currentSmoker: whether or not the patient is a current smoker
  2. cigsPerDay: the number of cigarettes that the person smoked on average in one day.

Medical history risk factors

  1. BPMeds: whether or not the patient was on blood pressure medication
  2. prevalentStroke: whether or not the patient had previously had a stroke
  3. prevalentHyp: whether or not the patient was hypertensive
  4. diabetes: whether or not the patient had diabetes

Risk factors from the first physical examination of the patient.

  1. totChol: total cholesterol level
  2. sysBP: systolic blood pressure
  3. diaBP: diastolic blood pressure
  4. BMI: Body Mass Index
  5. heartRate: heart rate
  6. glucose: glucose level
  7. TenYearCHD: 10 year risk of coronary heart disease CHD (TARGET VARIABLE)

Libraries Used -

  1. Pandas (for data manipulation)
  2. Matplotlib (for data visualization)
  3. Seaborn (for data visualization)
  4. Scikit-Learn (for data modeling)

Contents:

  1. Importing the required libraries.
  2. Importing and Reading the dataset.
  3. Exploratory Data Analysis (EDA)
  4. Data-Preprocessing
  5. Data Visualization
    • Correlation Matrix
    • Pairplot
    • Countplots
  6. Data Modeling
    • Separating the data into features and target variable.
    • Splitting the data into training and test sets.
    • Modeling/ Training the data
    • Predicting the data
    • Calculating the prediction scores
    • Getting the model's accuracy
      • Classification Report
      • Confusion Matrix
      • Plotting the confusion matrix

heart-disease-prediction's People

Contributors

ravjot03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

heart-disease-prediction's Issues

Output

Respected Sir, where is this Ai model showing whether the person will have chd or not (where exactly is the output showing)
Reach out to me as soon as you can as I have a project due tomorrow
I will be very thankful .

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.