Heart Disease Risk Predictor - ML Project with Streamlit App
Hey Streamlit community! ![]()
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
- Train model:
jupyter notebook heart.ipynb - 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