Sepsis Prediction API APP http://127.0.0.1:8000/docs#/
This project implements a machine learning model to predict sepsis in patients using a Random Forest Classifier. The model is deployed as a FastAPI application, allowing users to upload patient data, retrieve patient information, and make sepsis predictions through API endpoints.
To set up and run this project, follow these steps:
-
Install the required dependencies:
pip install pandas scikit-learn fastapi uvicorn joblib
-
Ensure you have the training data file
Paitients_Files_Train.csv
in the correct directory. -
Run the script to train the model and start the FastAPI server:
python main.py
The application provides three main functionalities:
- Upload patient data via CSV file
- Retrieve patient information by ID
- Predict sepsis for a specific patient
To use the API, you can make HTTP requests to the appropriate endpoints using tools like cURL or Postman.[1]
-
Upload Data
- Endpoint:
/upload
- Method: POST
- Description: Upload a CSV file containing patient data
- Endpoint:
-
Get Patient Data
- Endpoint:
/patient/{patient_id}
- Method: GET
- Description: Retrieve data for a specific patient by ID
- Endpoint:
-
Predict Sepsis
- Endpoint:
/predict/{patient_id}
- Method: POST
- Description: Make a sepsis prediction for a specific patient by ID[1]
- Endpoint:
[Ndumbe Moses N.]
(http://127.0.0.1:8000/docs#/)
This project demonstrates the implementation of a machine learning model for sepsis prediction, deployed as a user-friendly API. The Random Forest Classifier is trained on patient data and can provide predictions on new patient records. The FastAPI framework enables easy data upload, patient information retrieval, and sepsis predictions through well-defined endpoints.
The application showcases the integration of data preprocessing, model training, and API development, providing a complete solution for sepsis prediction in a clinical setting. Future improvements could include model performance optimization, additional data validation, and enhanced error handling.[1]