In this project, we leverage supervised machine learning techniques, specifically classification, to develop a predictive model aimed at identifying the likelihood of sepsis occurrence among patients admitted to Intensive Care Units (ICUs). Our classification model is designed to discriminate between patients who are likely to develop sepsis and those who are not, based on a comprehensive set of features.
Sepsis is a medical term which refers to any “generalized inflammatory response associated with a serious infection”. This lethal transmitted response occurs when the host's response to infection, systemic and severe inflammation of the body, causes damage to its own tissues and organs. It is accompanied by a cytokine shock. It is a potentially life-threatening condition and risk factors include:
- being very young or old
- a weakened immune system from conditions such as cancer or diabetes, major trauma, and burns.
(Source : Wikipedia)
The purpose is to enhance early detection and intervention for sepsis, thereby improving patient outcomes and reducing healthcare costs associated with prolonged ICU stays and intensive treatments.
The project is guided by the CRISP-DM (Cross-Industry Standard Process for Data Mining) framework.
Notebook | Docker Image | Published Article |
---|---|---|
Sepsis ML model notebook | Docker image on Docker Hub | Sepsis Prediction Article |
- Project Overview
- Project Links
- Some Tools Used For The Project
- Dataset
- Repository Setup
- Run FastAPI
- API Screenshots
- Author
Column Name | Attribute/Target | Description |
---|---|---|
ID | N/A | Unique number to represent patient ID |
PRG | Attribute1 | Plasma glucose |
PL | Attribute 2 | Blood Work Result-1 (mu U/ml) |
PR | Attribute 3 | Blood Pressure (mm Hg) |
SK | Attribute 4 | Blood Work Result-2 (mm) |
TS | Attribute 5 | Blood Work Result-3 (mu U/ml) |
M11 | Attribute 6 | Body mass index (weight in kg/(height in m)^2 |
BD2 | Attribute 7 | Blood Work Result-4 (mu U/ml) |
Age | Attribute 8 | patients age (years) |
Insurance | N/A | If a patient holds a valid insurance card |
Sepssis | Target | Positive: if a patient in ICU will develop a sepsis , and Negative: otherwise |
Install the required packages to be able to run the API locally.
You need to have Python 3
on your system. Then you can clone this repo and being at the repo's root :: repository_name> ...
follow the steps below:
-
Windows:
python -m venv venv; venv\Scripts\activate; python -m pip install -q --upgrade pip; python -m pip install -qr requirements.txt
-
Linux & MacOs:
python3 -m venv venv; source venv/bin/activate; python -m pip install -q --upgrade pip; python -m pip install -qr requirements.txt
The two long command-lines have the same structure. They pipe multiple commands using the symbol ;
but you can manually execute them one after the other.
- Create the Python's virtual environment that isolates the required libraries of the project to avoid conflicts;
- Activate the Python's virtual environment so that the Python kernel & libraries will be those of the isolated environment;
- Upgrade Pip, the installed libraries/packages manager to have the up-to-date version that will work correctly;
- Install the required libraries/packages listed in the
requirements.txt
file so that they can be imported into the python script and notebook without any issue.
NB: For MacOs users, please install Xcode
if you have an issue.
-
Run the API (being at the repository root):
FastAPI:
-
Main
uvicorn src.main:app --reload
-
Go to your browser at the local port, to explore the API's documentation :
-
Here is a tutorial for fastAPI
- App documentation
- Input
- Prediction
Andrew Obando
Connect with me on LinkedIn: LinkedIn Profile
Feel free to star ⭐ this repository if you find it helpful!