Skip to content

danitdev/heart-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❤️ Heart Disease Prediction

A machine learning project that predicts the presence of heart disease using patient medical data. The project explores the dataset, visualizes important relationships, compares multiple classification algorithms, and optimizes model performance through hyperparameter tuning.

📌 Project Overview

The objective of this project is to build a classification model capable of predicting whether a patient has heart disease based on clinical attributes such as age, sex, chest pain type, cholesterol level, and maximum heart rate.


✨ Features

  • Exploratory Data Analysis (EDA)
  • Data visualization with Matplotlib & Seaborn
  • Correlation heatmap
  • Feature relationship analysis
  • Multiple classification models
  • Hyperparameter tuning
  • Model evaluation and comparison

🛠️ Technologies Used

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

🤖 Machine Learning Models

The following models are implemented and compared:

  • Logistic Regression
  • K-Nearest Neighbors (KNN)
  • Random Forest Classifier

Hyperparameter tuning is performed using:

  • GridSearchCV
  • RandomizedSearchCV

📊 Dataset

The project uses the Heart Disease Dataset, containing medical information about patients including:

  • Age
  • Sex
  • Chest Pain Type
  • Resting Blood Pressure
  • Cholesterol
  • Maximum Heart Rate
  • Exercise Induced Angina
  • ST Depression
  • Number of Major Vessels
  • Thalassemia
  • Target (Heart Disease)

📈 Workflow

  1. Load and inspect the dataset
  2. Check for missing values
  3. Perform Exploratory Data Analysis
  4. Visualize feature relationships
  5. Create a correlation heatmap
  6. Split the data into training and testing sets
  7. Train multiple classification models
  8. Compare model performance
  9. Tune model hyperparameters
  10. Evaluate the final model

📂 Project Structure

heart-disease-prediction/
│
├── data/
│   └── heart-disease.csv
├── main.ipynb
├── README.md
└── .gitignore

🚀 Getting Started

Clone the repository:

git clone https://github.com/danitdev/heart-project.git

Install the required packages:

pip install pandas numpy matplotlib seaborn scikit-learn jupyter

Run Jupyter Notebook:

jupyter notebook

Open main.ipynb and execute the notebook.


📚 Concepts Practiced

  • Exploratory Data Analysis (EDA)
  • Data Visualization
  • Classification
  • Logistic Regression
  • K-Nearest Neighbors
  • Random Forest
  • Cross Validation
  • Hyperparameter Tuning
  • Model Evaluation
  • Correlation Analysis

🔮 Future Improvements

  • Perform feature selection
  • Try XGBoost and LightGBM
  • Improve preprocessing pipeline
  • Save the trained model with Joblib
  • Build a web interface using Django or Flask
  • Deploy the model online

👨‍💻 Author

Danial Hamidzadeh

GitHub: https://github.com/yourusername

Releases

No releases published

Packages

 
 
 

Contributors