prateekagr21 / Heart-condition-Analysis

Analyzing the Heart conditions of patients and predicting the Heart Failure using various Machine learning algorithms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heart-condition-Analysis

Analyzing the Heart conditions and Predicting the Heart Failure using some Machine Learning Algorithms.

The Heart wants what it wants ;)'

hf4

Significant changes have been noted in the structure and function of the cardiovascular system in older people that are considered to be the result of aging. These changes can be regarded as either adaptive or early preclinical disease, but they occur in the absence of clinically manifest dysfunction. Age-related changes are influenced by the presence of cardiovascular disease; therefore in order to study the effects of age on the cardiovascular system, individuals without subclinical or overt disease need to be identified.
Given the high prevalence of coronary artery disease in this population, careful screening is required and invasive tests such as coronary angiography may be necessary

Despite the advancement in medicine, management of heart failure, which usually presents as a disease syndrome, has been a challenge to healthcare providers. This is reflected by the relatively higher rate of readmissions along with increased mortality and morbidity associated with HF

Heart failure is a chronic and progressive clinical syndrome induced by structural or functional cardiac abnormalities displaying either reduced (in HF with reduced ejection fraction (HFrEF)) or preserved (in HF with preserved ejection fraction (HFpEF)) left ventricular ejection fraction (LVEF)1. Cardiac dysfunction leads to elevated cardiac filling pressures at rest and during stress. HF symptoms include dyspnoea (shortness of breath) and fatigue, often accompanied by typical physical signs, such as pulmonary rales (abnormal crackling sounds), peripheral oedema or distended jugular veins.

Heart failure is not a single pathological diagnosis, but a clinical syndrome consisting of cardinal symptoms (e.g. breathlessness, ankle swelling, and fatigue) that may be accompanied by signs (e.g. elevated jugular venous pressure, pulmonary crackles, and peripheral oedema). It is due to a structural and/or functional abnormality of the heart that results in elevated intracardiac pressures and/or inadequate cardiac output at rest and/or during exercise.

hf3

For Solving this Usecase, What I have done is :

  • Collected the data and organized it to form a meaningful dataset.
  • Checked for null values and took care of it.
  • Observed the data to form meaningful insights!

  • Did Exploratory Data Analysis on the dataset.
  • Used correlations to form a heatmap!!

For Visualizations, i used :

  • Visualizations were made by using Matplotlib and Seaborn Libraries..!! hf2

Did Data Pre-Processing and Feature Engineering :

  • Made dummies for improving my model's Performance.
  • One-hot-Encoding was Implemented.
  • Made Binary Classifications Using Label Encoder and Standard Scaler
    To fit and transform Numerical and Categorical Column values.

And then I made my model for the Prediction :

  • Did data processing
  • Independent and Dependent Features.
  • Did Train-Test split

hf1

Trained my Model using :

  • Logistic Regresson
  • Random Forest Classifier
  • Support Vector Machine
  • Ada Boost Classifier

hf6

Logistic Regression

  • Predicted for the data
  • Finded Accuracy score
  • Plotted Confusion Matrix
  • And at last, Classification report.

Random Forest Classifier

  • Predicted for the data
  • Finded Accuracy score
  • Plotted Confusion Matrix
  • And at last, Classification report.
  • And Analyzed the key factors responsible for prediction.

Support Vector Machine

  • Predicted for the data
  • Finded Accuracy score
  • Plotted Confusion Matrix
  • And at last, Classification report.

Ada boost Classifier

  • Predicted for the data
  • Finded Accuracy score
  • Plotted Confusion Matrix
  • And at last, Classification report.

hf7

And Now, Speeding towards the conclusion -

From the above Four trained Models, It can be seen that
With the Accuracy of around 86.41%,
the Support Vector Machine Model performed slightly better than rest of the Models.


hf5



About

Analyzing the Heart conditions of patients and predicting the Heart Failure using various Machine learning algorithms.


Languages

Language:Jupyter Notebook 100.0%