AI Heart Doctor is a user-friendly web application built with Streamlit that leverages machine learning to predict the likelihood of heart disease based on key health metrics. The app provides real-time risk assessments, personalized health recommendations, and intuitive visualizations to help users understand their heart health.
Experience the app in action: https://doctoraiheart.streamlit.app/
- Real-Time Risk Prediction: Input personal health data to receive an immediate heart disease risk assessment.
- Interactive Visualizations: Utilize a color-coded gauge chart to visualize risk levels.
- Personalized Health Tips: Receive tailored advice based on your risk category.
- User-Friendly Interface: Designed with a modern, responsive layout for an optimal user experience.
- Streamlit: For building the interactive web application.
- Pandas: For data manipulation and analysis.
- Scikit-learn: For implementing the machine learning model.
- Plotly: For creating interactive visualizations.
- Pickle: For loading the pre-trained machine learning model.
To run the application locally:
-
Clone the repository:
git clone https://github.com/yourusername/heart-disease-prediction.git cd heart-disease-prediction -
Install the required dependencies:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run app.py
-
Open the provided local URL in your browser to interact with the app.
Provide the following health metrics to receive a risk prediction:
- Age: Your age in years.
- Sex: Gender (Male/Female).
- Chest Pain Type: Type of chest pain experienced.
- Resting Blood Pressure: Blood pressure at rest (in mm Hg).
- Cholesterol: Serum cholesterol level (in mg/dl).
- Fasting Blood Sugar: Whether fasting blood sugar > 120 mg/dl (Yes/No).
- Resting Electrocardiographic Results: Resting electrocardiographic results.
- Maximum Heart Rate Achieved: Maximum heart rate achieved during exercise.
- Exercise Induced Angina: Presence of exercise-induced angina (Yes/No).
- Oldpeak: ST depression induced by exercise relative to rest.
- Slope: Slope of the peak exercise ST segment.
After entering your health data and clicking "Predict ❤️":
- Risk Gauge: A color-coded gauge chart indicating the percentage risk of heart disease.
- Risk Category: A classification of your risk as either "High Risk" or "Low Risk".
- Health Tips: Personalized advice based on your risk category.
The application utilizes a Logistic Regression model trained on a dataset containing various health metrics. The model's performance is evaluated using accuracy, precision, recall, and F1-score metrics to ensure reliable predictions.
The app is deployed on Streamlit Cloud, allowing users to access it directly from their browsers without any installation.
This project is licensed under the MIT License - see the LICENSE file for details.