The goal of this project is to develop a machine learning model that predicts the likelihood of early readmission for hospital patients. The model will be trained using a dataset containing patient demographics, medical history, and hospital outcomes. The primary focus will be on improving the accuracy and interpretability of the model, as well as ensuring that it is fair and unbiased.
Data Source: https://archive.ics.uci.edu/dataset/296/diabetes+130-us+hospitals+for+years+1999-2008
Research Reference: https://onlinelibrary.wiley.com/doi/10.1155/2014/781670 Impact of HbA1c Measurement on Hospital Readmission Rates: Analysis of 100k Clinical Database Patient Record By Beata Strack, Jonathan DeShazo, Chris Gennings, Juan Olmo, Sebastian Ventura, Krzysztof Cios, John Clore.
- Develop a machine learning model that accurately predicts early readmission for hospital patients.
- Implement feature engineering techniques to improve the model's performance and interpretability.
- Evaluate the model's fairness and unbiasedness, ensuring that it does not discriminate against certain patient groups.
- Develop a user-friendly web application that allows users to input patient information and receive predictions from the model.
- Document the project's progress, challenges, and lessons learned throughout the development process.
- Programming languages: Python, SQL, HTML, CSS, Javascript
- Machine Learning: Logistic Regression, Random Forest Classifier, Gradient Boost Classifier
- Frontend: Javascript (for frontend Web UI)
- Backend: Flask (for API services)
- Containerization: Docker
- Cloud: AWS ECS, AWS S3
- Model Tracking: MLflow
- Version Control: Github
User Input: User interacts with the Frontend web UI before discharging patient from the hospital.
Backend API: Flask(uvicorn server) processes the input, triggering the fraud prediction model.
ML Model: Logistic Regression model, loaded via MLflow, predicts if the patient going to readmit in the hospital.
Storage: All processed data and predicted data is stored in AWS S3.
Deployment: The application is dockerized and deployed on AWS ECS.
To run the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/rohit180497/Early-readmission-of-patients-in-hospital.git
cd Early-readmission-of-patients-in-hospital/src- Build and run the Docker container:
docker build -t Early-readmission-of-patients-in-hospital .
docker run -p 8000:8000 Early-readmission-of-patients-in-hospital- Install dependencies (if not using Docker):
pip install -r requirements.txt- Run Flask Application:
python app.py --host 0.0.0.0 --port 8000 Access the Flask Application for predictions at: http://localhost:8000
Submit patient data through the web interface to get predictions on whether a patient will readmit in the hospital.
This project is deployed using AWS Elastic Container Service (ECS) with Docker. The following services are used in the deployment process:
AWS ECS: For managing the Docker container cluster.
AWS S3: For storing the input/output data.
AWS ECR: For storing the Docker images.
-
Push the Docker image to AWS ECR.
-
Create an ECS cluster and task definition to run the Docker container.
-
Expose port 8000 to make the service publicly accessible.
-
Model: Logistic Regression
-
Threshold: 0.45
-
Metric: Recall (77%)
-
Capture Rate: 63% in the top 4 percentile.

