Skip to content

Repository files navigation

Heart Disease Prediction using Machine Learning

Project Overview

This project focuses on predicting the likelihood of heart disease using machine learning techniques. By analyzing clinical healthcare data, the model identifies patterns and risk factors associated with heart disease and helps estimate whether a patient is at risk.

The goal of this project is to demonstrate a complete data science workflow, including data preprocessing, exploratory data analysis (EDA), model training, and evaluation using classification algorithms.


Dataset

The dataset contains various medical attributes related to heart health, including:

  • Age
  • Sex
  • Chest pain type
  • Resting blood pressure
  • Cholesterol level
  • Fasting blood sugar
  • Resting ECG results
  • Maximum heart rate achieved
  • Exercise induced angina
  • ST depression
  • Slope of peak exercise ST segment

Target variable:

  • 0 → No Heart Disease
  • 1 → Heart Disease Present

Technologies Used

  • Python
  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Scikit-learn
  • Jupyter Notebook

Project Workflow

  1. Importing required libraries
  2. Loading and exploring the dataset
  3. Data cleaning and preprocessing
  4. Exploratory Data Analysis (EDA)
  5. Feature engineering
  6. Training multiple machine learning models
  7. Model evaluation and comparison
  8. Generating insights from the data

Machine Learning Models Used

The following classification algorithms were implemented and compared:

  • Logistic Regression
  • Random Forest
  • Support Vector Machine (SVM)
  • K-Nearest Neighbors (KNN)

Model performance was evaluated using:

  • Accuracy
  • Confusion Matrix
  • Classification Metrics

Results

The machine learning models were trained and evaluated on the dataset to identify the most accurate model for heart disease prediction. The results highlight how machine learning can assist healthcare professionals in early detection and risk assessment.


Key Insights

  • Certain clinical factors such as age, cholesterol levels, and chest pain type significantly influence heart disease prediction.
  • Machine learning models can effectively classify patients into risk categories based on medical attributes.

Future Improvements

  • Hyperparameter tuning to improve model performance
  • Deployment using web frameworks (Streamlit / Flask)
  • Integration with larger healthcare datasets
  • Development of a real-time prediction interface

How to Run the Project

  1. Clone the repository
git clone https://github.com/maheshsharma01/Heart-Disease-Prediction-using-Machine-Learning.git
  1. Navigate to the project folder
cd Heart-Disease-Prediction-using-Machine-Learning
  1. Install required libraries
pip install -r requirements.txt
  1. Run the notebook
jupyter notebook

Author

Mahesh Sharma

Machine Learning & Data Science Enthusiast

M.Tech in Computer Science and Engineering

About

Machine learning project for predicting heart disease risk using classification models and healthcare data analysis.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages