A machine learning project to predict maternal health risk levels during pregnancy using patient data. This project includes a Jupyter Notebook for model training and a Streamlit web app for interactive predictions.
This project addresses the critical issue of maternal health by providing a tool to predict potential health risks for expectant mothers. It uses the Maternal Health Risk Dataset from UCI which contains biometric data such as age, blood pressure, and heart rate.
The core of the project is a Random Forest Classifier trained to categorize risk into three levels: Low Risk, Mid Risk, and High Risk.
Maternal-Health-Risk-Predictor/
│
├── app.py # The Streamlit web application
|
├── maternal_health_prediction.ipynb # Jupyter Notebook for data analysis and model training
│
├── maternal_risk_model.joblib # Saved trained model
|
├── scaler.joblib # Saved scaler object
|
├── label_encoder.joblib # Saved label encoder object
│
├── requirements.txt # Project dependencies
|
└── README.md # Project explanation
To set up the project locally, follow these steps:
-
Clone the repository:
git clone (this repo link) cd Maternal-Health-Risk-Predictor
python -m venv venv
venv\Scripts\activate
python3 -m venv venv
source venv/bin/activate
Install the required dependencies:
pip install -r requirements.txt
There are two main components to this project:
1.Jupyter Notebook: Explore the Maternal Health Risk Predictor.ipynb notebook to see the full workflow, including data exploration, preprocessing, model training, and evaluation.
-
Streamlit Web App: To launch the interactive prediction app, run the following command in your terminal:
streamlit run app.py
Your web browser will open with the application running.
The final Random Forest model achieved an overall accuracy of 86.21% on the test set.
This project is licensed under the MIT License. See the LICENSE file for details.