New hamna663/heart-disease-prediction-app Streamlit App

Heart Disease Risk Predictor - ML Project with Streamlit App

Hey Streamlit community! :waving_hand:

I’ve built a complete heart disease prediction project using the public Heart Disease dataset. It includes a Jupyter notebook for model training and a Streamlit web app for interactive predictions.

Model Training (heart.ipynb)

  • Data Prep: Handled missing values, one-hot encoded categoricals, scaled numerical features (Age, RestingBP, Cholesterol, MaxHR, Oldpeak)
  • EDA: Visualized distributions and correlations
  • Models Tested: Logistic Regression, KNN, Naive Bayes, Decision Tree, SVM
  • Selected: Logistic Regression (strong accuracy and F1-score)
  • Output: Pickled model, scalers, and feature list

Streamlit App (app.py)

  • Inputs: Sliders/dropdowns for patient data
  • Features: CSV upload, sample data download, real-time feature summary
  • Prediction: Binary result + probability confidence
  • UX: Fixed prediction section, visual feedback with balloons

Tech Stack

  • Pandas, NumPy, Scikit-learn, Matplotlib, Seaborn
  • Streamlit for web interface
  • Pickle for model persistence

How to Run

  1. Train model: jupyter notebook heart.ipynb
  2. Run app: pip install -r requirements.txt && streamlit run app.py

Full code on GitHub: GitHub - hamna663/Heart-Disease-Prediction-App · GitHub

What do you think? Suggestions for improvements?

#MachineLearning streamlit #DataScience healthcare

1 Like