Skip to content

anshita2004/Heart-disease-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿซ€ Heart Disease Classification using Machine Learning

This project implements a Heart Disease Prediction System using multiple machine learning algorithms to classify the presence of heart disease based on various clinical features.

๐Ÿ“Œ Table of Contents


๐Ÿ“– About

The goal of this project is to use machine learning to predict the presence of heart disease based on medical attributes. It uses the UCI Heart Disease dataset and tests the performance of five popular classification algorithms.


๐Ÿ› ๏ธ Tools & Technologies Used

Tool/Library Purpose
Python Programming Language
Pandas Data manipulation
NumPy Numerical operations
Scikit-learn ML models and preprocessing
Matplotlib & Seaborn Data visualization
Jupyter Notebook / VS Code Development IDE

๐Ÿ“ Dataset

Dataset Source:

You can also use the heart.csv file provided in this repository.


โœ… Features

The dataset contains the following features:

  • age
  • sex
  • cp (chest pain type)
  • trestbps (resting blood pressure)
  • chol (serum cholesterol)
  • fbs (fasting blood sugar)
  • restecg (resting ECG)
  • thalach (maximum heart rate)
  • exang (exercise-induced angina)
  • oldpeak (ST depression)
  • slope (slope of the ST segment)
  • ca (number of major vessels)
  • thal
  • target (0 = no disease, 1 = has disease)

๐Ÿง  ML Algorithms Used

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

๐Ÿ’ป Installation

# Clone the repo
git clone https://github.com/yourusername/heart-disease-classification.git
cd heart-disease-classification

# Install required libraries
pip install pandas numpy matplotlib seaborn scikit-learn

๐Ÿš€ Usage

  1. Place heart.csv in the project directory.
  2. Run the script:
python heart_disease_prediction.py
  1. View the accuracy, classification report, and feature importance chart in the output.

๐Ÿ“Š Results

Example model performance (accuracy may vary by dataset size):

Model Accuracy (Sample)
Logistic Regression ~85%
Random Forest ~90%
SVM ~86%
KNN ~84%
Decision Tree ~80%

๐Ÿ”ฎ Future Improvements

  • Hyperparameter tuning using GridSearchCV
  • K-Fold Cross-validation
  • Model deployment using Flask or Streamlit
  • Ensemble learning with VotingClassifier
  • Larger real-world dataset

๐Ÿ“œ License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published