Inspiration
The healthcare system in Rwanda, like many countries, faces challenges in managing limited hospital resources, predicting disease outbreaks, and reducing patient readmissions. Inspired by the need for data-driven healthcare solutions, this project was created to demonstrate how predictive analytics and machine learning can support clinical decision-making, optimize resource allocation, and improve patient care quality.
What it does
The project predicts patient readmission risks (e.g., within 30 days) based on hospital data such as age, gender, primary diagnosis, comorbidities, and past hospital visits. Key functionalities include: Risk scoring for each patient. Interactive dashboard (Streamlit) for visualizing patient data and predictions. API service (FastAPI) that provides model predictions for integration with hospital information systems. CI/CD pipeline to automate testing and deployment.
How we built it
Data Collection & Preprocessing Collected publicly available hospital datasets and tailored them to a Rwandan healthcare context. Cleaned and transformed data using pandas (e.g., handling missing values, encoding categorical variables). Machine Learning Model Used scikit-learn to train a logistic regression classifier as the baseline model. Split data into training and testing sets (80/20) and evaluated performance metrics (accuracy, recall, precision). Deployment & CI/CD Built an API using FastAPI and an interactive dashboard using Streamlit. Created a GitHub Actions CI/CD pipeline for continuous testing and deployment. Containerized the project with Docker for cross-platform portabilit
Challenges we ran into
Data Availability: Finding high-quality, anonymized hospital datasets relevant to Rwanda was difficult, requiring dataset simulation for demonstration purposes. Model Generalization: Balancing bias and variance due to limited training data. DevOps Complexity: Setting up a robust CI/CD pipeline and containerized deployment required learning new tools like Docker and GitHub Actions. Familiarity: It was very complicated to be familiar with the languages used in DevOps
Accomplishments that we're proud of
Building a working end-to-end predictive analytics pipeline, from data preprocessing to deployment. Designing a user-friendly dashboard to assist healthcare decision-makers. Implementing automated CI/CD workflows that enhance reproducibility and reliability.
What we learned
How to integrate machine learning with DevOps pipelines (MLOps approach). The importance of data preprocessing and feature engineering in healthcare datasets. Practical experience with FastAPI, Streamlit, and GitHub Actions for real-world project deployment. The value of explainability in AI models, especially for healthcare, where transparency builds trust.
What's next for Healthcare Predictive Analytics
The current version of this project serves as a baseline for predicting patient readmission risks using logistic regression. In the future, we aim to:
- Expand the Dataset Integrate real-world Rwandan hospital data (anonymized) and public health datasets. Add additional features like lifestyle factors, lab results, and medication adherence.
- Enhance Predictive Models Move beyond logistic regression to advanced models like XGBoost, Random Forests, or Neural Networks for improved accuracy. Introduce ensemble learning and hyperparameter tuning with tools like Optuna.
- Real-Time Data Streaming Implement real-time data pipelines using tools like Kafka or Apache Spark for live monitoring of patient risks and disease outbreaks.
- Explainability and Fairness Integrate explainable AI (XAI) techniques such as SHAP or LIME to ensure predictions are transparent and interpretable by healthcare professionals. Evaluate fairness and bias across different patient demographics.
- Scalable Deployment Deploy the API and dashboard on cloud platforms (AWS, Azure, GCP) with load balancing and monitoring. 6.Integration with Healthcare Systems Build APIs that integrate seamlessly with Electronic Health Records (EHRs) used in Rwanda and other African healthcare systems. Develop a mobile-friendly interface for healthcare workers in rural areas.
- Outbreak Prediction Module Extend the model to detect early signals of disease outbreaks (e.g., malaria, cholera) using regional epidemiological data. Provide early warnings to public health officials.
- Collaboration & Open Source Open-source the project and encourage collaboration with local universities and health organizations. Add community-driven datasets and models for continuous improvement.