Skip to content

mohakbiswas-coding/ECG_Denoizing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heart Disease Risk Prediction

This repository contains a project aimed at predicting the risk of heart disease using machine learning models. The workflow involves comparing multiple datasets and evaluating the performance of various models to identify the most suitable dataset and model for the task.

Project Overview

This project uses three datasets to train and evaluate machine learning models for heart disease prediction. The datasets are:

  1. heart.csv (Source 1)
  2. heart-2.csv (Source 2)
  3. heart-3.csv (Source 3)

Workflow

1. Data Loading and Preprocessing

  • Each dataset was loaded and inspected for missing values.
  • Missing values were dropped.
  • Categorical columns were encoded using one-hot encoding.

2. Feature and Target Split

  • For each dataset, the target column was identified:
    • heart.csv: target
    • heart-2.csv: output
    • heart-3.csv: HeartDisease
  • Features (X) and target (y) were separated.

3. Train-Test Split

  • The data was split into training and testing sets using an 80-20 split.

4. Model Training and Evaluation

  • The following machine learning models were trained and evaluated:
    • Logistic Regression
    • Random Forest
    • Support Vector Machine (SVM)
    • XGBoost
    • K-Nearest Neighbors (KNN)
    • Naive Bayes
  • Performance metrics used for evaluation:
    • Accuracy
    • ROC AUC Score

5. Dataset Comparison

  • Each dataset was evaluated using the above models.
  • The performance metrics were compared across datasets.

Datasets Quality Overview

Dataset Overview

Model Metrics Comparison

Model Metrics

6. Feature Importance Analysis

  • For models that support feature importance (e.g., Random Forest, XGBoost), the top features contributing to predictions were identified and visualized.

Feature Importance for Dataset-Model Combinations

  • Dataset 1:
    • Logistic Regression: D1-LR
    • Random Forest: D1-RF
    • XGBoost: D1-XG
  • Dataset 2:
    • Logistic Regression: D2-LR
    • Random Forest: D2-RF
    • XGBoost: D2-XG
  • Dataset 3:
    • Logistic Regression: D3-LR
    • Random Forest: D3-RF
    • XGBoost: D3-XG

Results

  • Dataset-1 is chosen for making predictions due to its large volume and better model performance
  • Random Forest model has been implemented on Dataset-1 due to its consistent performance
  • Most important features were identified cooresponding to this model

Future Work

Integration with IoT and ECG Sensors

To enhance the application, the following fields can be inferred or measured using IoT-enabled ECG sensors:

  1. Resting ECG (restecg):

    • Captured directly from ECG sensors to classify as normal, ST-T wave abnormality, or left ventricular hypertrophy.
  2. Oldpeak:

    • Derived from ST depression measurements during exercise relative to rest.
  3. Slope:

    • Determined from the behavior of the ST segment during physical activity.
  4. Max Heart Rate (thalach):

    • Measured directly as the maximum heart rate achieved during exercise.
  5. Exercise Induced Angina (exang):

    • Inferred from ischemic changes detected in ECG patterns during exercise.

Additional Enhancements

  • Real-time Data Integration:

    • Use IoT devices to stream real-time ECG data to the application.
    • Implement APIs or MQTT protocols for seamless data transfer.
  • Machine Learning Models:

    • Train models on ECG data to infer fields like exang and slope with higher accuracy.
  • Advanced Metrics:

    • Incorporate Heart Rate Variability (HRV) and other ECG-derived metrics for deeper insights into cardiac health.

This future work aims to integrate IoT capabilities, enabling real-time and automated data collection for improved predictions and patient monitoring.

About

ML pipeline for predicting Heart Disease Risk by evaluating open-source datasets and model performance metrics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages