Icon

Heart Disease Prediction - Build Classifier Model

<p>This workflow demonstrate how machine learning, specifically using the <strong>Logistic Regression</strong>, can be used to predict whether a patient has heart disease. The goal is to distinguish between patients with heart disease and those without, based on various health-related attributes.</p><p></p><p>Dataset attribute:</p><ul><li><p><strong>age</strong>: Age of the patient (in year)</p></li><li><p><strong>sex</strong>: Sex of the patient (1 = male, 0 = female)</p></li><li><p>chest pain type (<strong>cp</strong>): Type of chest pain (4 values: 1 = typical angina, 2 = atypical angina, 3 = non-anginal pain, 4 = asymptomatic)</p></li><li><p>resting blood pressure (<strong>tresbps</strong>): Resting blood pressure in mm Hg</p></li><li><p>serum cholesterol (<strong>chol</strong>): Serum cholesterol in mg/dl</p></li><li><p>fasting blood sugar &gt; 120 mg/dl&nbsp; (<strong>fbs</strong>): Fasting blood sugar level &gt; 120 mg/dl (1 = true, 0 = false)</p></li><li><p>resting electrocardiographic results (<strong>restecg</strong>): Electrocardiographic results (values: 0 = normal, 1 = having ST-T wave abnormality, 2 = left ventricular hypertrophy)</p></li><li><p>maximum heart rate achieved (<strong>thalach</strong>): Maximum heart rate achieved during exercise</p></li><li><p>exercise induced angina (<strong>exang</strong>): Whether exercise induced angina (1 = yes, 0 = no)</p></li><li><p><strong>oldpeak</strong>: ST depression induced by exercise relative to rest</p></li><li><p>slope of peak exercise ST segment (<strong>slope</strong>): Slope of the peak exercise ST segment (1 = upsloping, 2 = flat, 3 = downsloping)</p></li><li><p>number of major vessels: Number of major vessels colored by fluoroscopy (0-3)</p></li><li><p><strong>thal</strong>: Thalassemia (0 = normal, 1 = fixed defect, 2 = reversible defect)</p></li><li><p><strong>target </strong>(Heart Disease): Target variable indicating heart disease (1 = disease, 0 = no disease)</p></li></ul>

URL: Heart Disease Dataset on Kaggle https://www.kaggle.com/datasets/johnsmith88/heart-disease-dataset/data

Data import
Data Analysis
Data Preprocessing
Model Evaluation
Build Model
  • training & testing model

Heart Disease Prediction - Build Classifier Model

  • Classifier model use Logistic Reggression

  • Evaluate model using: Metric, ROC curve and AUC-ROC curve

Density Plot
File Reader
select the data columns
Column Filter
train set =80%,test set=20%
Partitioning
trainig model using train set
Logistic Regression Learner
Linear Correlation
save model into a file
Model Writer
testing the model using test set to predict
Logistic Regression Predictor
Scatter Plot
Scorer
check imbalanced 'target' class
Bar Chart
Statistics View
z score 0 mean 1 standar deviasi
Normalizer
Generate an ROCcurve plot using thedataframe
Generic ECharts View
Generate an AUC ROCcurve plot
Generic ECharts View
convert 'target' columndata type to string
Number to String

Nodes

Extensions

Links