Skip to content

MarthaK-Coder/Azubi-Africa-P6-Machine-Learning-API-using-FastAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Predicting Sepsis Onset with FastAPI: A Dockerized Machine Learning Approach

FastAPI Python Docker

Table of Contents

  1. Introduction
  2. Business Understanding
  3. Data Understanding
  4. Data Preparation
  5. Model Training and Evaluation
  6. FastAPI and Dockerization
  7. Conclusion

Introduction

Timely prediction of sepsis onset is crucial for enhancing patient outcomes in healthcare. This project explores the application of machine learning classification models to predict sepsis, encapsulating the solution within a Docker container and exposing it through FastAPI for seamless deployment.

Business Understanding

In shaping our project's trajectory, we center our attention on a critical healthcare challenge: predicting sepsis onset based on patient data. Our primary focus is to formulate hypotheses and questions that delve into the heart of this problem. The overarching hypothesis is rooted in the belief that early sepsis detection can significantly enhance patient outcomes.

Data Understanding

Loading Datasets and Exploratory Data Analysis (EDA)

Initiating the project with loading datasets and conducting exploratory data analysis (EDA) to gain insights:

  • What features are available in the dataset?
  • How should missing values be handled?
  • What is the distribution of sepsis cases in the dataset?

Data Preparation

Data Splitting and Balancing Classes

Addressing class imbalance by splitting data into training and testing sets and employing techniques such as oversampling or undersampling.

Creating a Preprocessing Pipeline

Developing a preprocessing pipeline to streamline tasks like imputing missing values, scaling features, and encoding categorical variables.

Model Training and Evaluation

Selecting and Training Models

Experimenting with classification models (Random Forest, Logistic Regression, Gradient Boosting) to identify well-performing models for sepsis prediction.

Model Evaluation

Utilizing metrics like precision, recall, and F1 score with a focus on sensitivity for effective sepsis case capture.

Hyperparameter Tuning

Achieving optimal model performance through hyperparameter tuning using techniques like grid search or random search.

Model Persistence

Persisting selected models for easy deployment, eliminating the need for retraining.

FastAPI and Dockerization

Building a FastAPI

FastAPI serves as the foundation for our API, designed to take patient data as input and return the predicted likelihood of sepsis onset.

Screenshots

FastAPI Screenshots

Docker Containerization

Encapsulating the solution within a Docker container to ensure consistency and eliminate dependency issues across different environments.

Screenshots

Docker Screenshots

Pushing to Docker Hub

Pushing the Docker image to Docker Hub, facilitating accessibility and deployment on various platforms. link: https://hub.docker.com/repository/docker/marthakcoder/sespis-api/general ![Docker Hub Screenshots](./screenshots/docker hub.JPG)

Conclusion

By combining machine learning, FastAPI, and Docker, we create a robust solution for predicting sepsis onset. The seamless integration of predictive analytics and healthcare demonstrates the potential for early intervention and improved patient outcomes. The titled approach, "Predicting Sepsis Onset using FastAPI: A Dockerized Machine Learning Approach," underscores the intersection of technology and healthcare for impactful predictive analytics.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages