Skip to content

Repository files navigation

❤️ Heart Disease Risk Prediction using Machine Learning

📌 Project Overview

This project predicts the likelihood of heart disease based on patient medical information using Machine Learning techniques.

The application performs data preprocessing, feature scaling, model comparison, and prediction through an interactive Streamlit web application.

The final model was trained using Logistic Regression and deployed using Streamlit.


🌐Live Demo

https://heart-disease-risk-predictorgit-gh7rwybjhsrcodifjeysru.streamlit.app/

🚀 Features

  • Data Cleaning and Preprocessing
  • Exploratory Data Analysis (EDA)
  • Feature Engineering
  • One-Hot Encoding
  • Feature Scaling using StandardScaler
  • Multiple ML Model Comparison
  • Heart Disease Risk Prediction
  • Interactive Streamlit Web Application
  • Probability-Based Risk Score

🛠️ Technologies Used

  • Python
  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Scikit-Learn
  • Joblib
  • Streamlit

📊 Machine Learning Models Evaluated

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

After evaluation, Logistic Regression achieved the best performance and was selected as the final model.


📂 Project Structure

Heart_Disease_Prediction/
│
├── app.py
├── heart_risk_pred.ipynb
├── Logistic_Regression_heart.pkl
├── heart_scaler.pkl
├── heart_columns.pkl
└── README.md

⚙️ Installation

Clone the repository:

git clone https://github.com/your-username/heart-disease-risk-prediction.git

Move into the project directory:

cd heart-disease-risk-prediction

Install dependencies:

pip install -r requirements.txt

Run the application:

python -m streamlit run app.py

🩺 Input Features

The model uses the following patient attributes:

  • Age
  • Sex
  • Chest Pain Type
  • Resting Blood Pressure
  • Cholesterol
  • Fasting Blood Sugar
  • Resting ECG
  • Maximum Heart Rate
  • Exercise-Induced Angina
  • Oldpeak
  • ST Slope

🎯 Prediction Output

The application predicts:

  • Low Risk of Heart Disease ✅
  • High Risk of Heart Disease ⚠️

It also provides a probability-based risk score for better interpretation.


📈 Workflow

  1. Data Collection
  2. Data Cleaning
  3. Exploratory Data Analysis
  4. Feature Engineering
  5. Data Encoding
  6. Feature Scaling
  7. Model Training
  8. Model Evaluation
  9. Model Selection
  10. Streamlit Deployment

⚠️ Disclaimer

This project is developed for educational and learning purposes only.

The predictions generated by this model should not be considered professional medical advice. Always consult qualified healthcare professionals for medical diagnosis and treatment.


👩‍💻 Author

Yashasvi Tomar

B.Tech Electronics Engineering Machine Learning Enthusiast

About

Heart Disease Risk Predictor is a machine learning application that predicts the likelihood of heart disease based on patient health parameters. It uses data preprocessing, feature engineering, and a trained classification model to provide accurate risk predictions through an easy-to-use interface.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages