Prach-404/Heart-Attack-Risk-Predictor
0
**Make sure `sdk: streamlit` is there!**
Heart Disease Risk Predictor ๐
A machine learning web application that predicts cardiovascular risk levels based on personal, medical, and lifestyle information. Built with Streamlit and Scikit-learn, this app provides real-time predictions along with visual probability distributions for different risk levels.
Features
Real-time risk prediction โ Predicts Low, Medium, or High cardiovascular risk.
Interactive visualizations โ Probability distribution of each risk level displayed via Plotly bar charts.
BMI auto-calculation โ Calculates BMI automatically from height and weight inputs.
Height conversion โ Accepts height in feet & inches and converts it to centimeters.
User-friendly interface โ Clean, responsive design with a soft pink theme.
Handles categorical and numerical inputs โ Includes age, smoking, alcohol, exercise, and other medical factors.
How to Run
This app is deployed as a Hugging Face Space using Streamlit.
To run locally:
pip install -r requirements.txt
streamlit run app.py
On Hugging Face, the app runs automatically in the Space. Simply open the Space link to interact with it.
Model
Model
Algorithm: Logistic Regression
Features: [Replace with actual number, e.g., 20 features including age, gender, blood pressure, cholesterol, BMI, etc.]
Target: Cardiovascular risk level (Low, Medium, High)
Preprocessing: Label encoding for categorical features, StandardScaler for numerical features
Dataset
The model was trained on a heart disease dataset including medical and lifestyle features, enhanced with diet quality information.
Disclaimer
Informational Only: This app is for educational purposes and not a medical diagnosis tool. Predictions are based on historical data and may not reflect actual health conditions. Always consult a healthcare professional for medical advice.
Technologies Used
Python โ Data processing and backend
Streamlit โ Web application framework
Scikit-learn โ Machine learning model
Pandas & NumPy โ Data manipulation
Plotly โ Interactive visualizations