This project aims to predict Cardiovascular Disease (CVD) Risk based on a set of health-related features. It utilizes both Machine Learning and Deep Learning algorithms to provide accurate predictions, with a neural network model achieving an impressive accuracy of 91.92%. The project includes a front-end web application built using Flask and deployed on Streamlit for broader accessibility.
- Exploratory Data Analysis (EDA): Comprehensive analysis of features and their relationships to identify critical insights.
- Model Development: Implementation of various machine learning models, including a Neural Network, with performance tuning for optimized results.
- Deployment: End-to-end deployment using Flask and Streamlit, with a fully functional web interface for users to input their health data and receive predictions.
- Real-time Predictions: Users can input real-time health data and receive immediate predictions for their cardiovascular risk.
- Conducted univariate and bivariate analysis to understand the distribution of features and their correlations with the target.
- Used correlation heatmaps to assess the relationships between different variables.
- Reduced and selected the most important features based on correlation analysis and domain knowledge.
- Split the dataset into training and testing sets for model evaluation.
- Trained multiple models, including Neural Networks, Logistic Regression, and Decision Trees.
- Achieved a 91.92% accuracy with the Neural Network model, validated through metrics like Mean Squared Error (MSE) and RΒ² score.
- Hyperparameter tuning was performed for further optimization.
- Integrated the model into a Flask web application with a clean, user-friendly interface.
- Deployed on Streamlit for cloud-based access, allowing users to input health data and get real-time risk predictions.
git clone https://github.com/your-github-username/cardiovascular-disease-prediction-app.git
python -m venv myenv
- Windows:
.\myenv\Scripts\activate
- Linux/MacOS:
source myenv/bin/activate
Install all necessary libraries listed in requirements.txt
:
pip install -r requirements.txt
- To run the Flask-based app locally, use the command:
python flask_app.py
- Run the Streamlit app using the following command:
streamlit run streamlit_app.py
Single feature analysis to visualize individual data distributions.
Analyzing relationships between features and the target variable.
Explore relationships between variables to identify key contributors to cardiovascular risk.
- Model Accuracy: The Neural Network model achieved 91.92% accuracy, demonstrating its reliability in predicting cardiovascular disease risk.
- Real-time Web Interface: The web application, deployed using Flask, allows users to input their health parameters and instantly receive predictions on their cardiovascular risk.
- Streamlit Deployment: The application has also been deployed on Streamlit for easy, cloud-based access.
- Accuracy: 91.92%
- Python:
Libraries:scikit-learn
,TensorFlow
,Pandas
,Matplotlib
,Seaborn
,joblib
- Flask:
Framework for creating the web app interface. - Streamlit:
For cloud-based app deployment. - Jupyter Notebooks:
For conducting Exploratory Data Analysis (EDA) and model development.
The CVD Risk Prediction Model demonstrates high accuracy and practical applicability. With its 91.92% accuracy, it can serve as a valuable tool for health professionals and individuals alike. The streamlined front-end design, built using Flask and deployed on Streamlit, ensures ease of use for non-technical users to assess their cardiovascular risk based on health data.