Giter VIP home page Giter VIP logo

aki_detection's Introduction

A Decision tree based AKI detection model for Hospital System

Design Overview

  1. using pandas, numpy to read and preprocess patients' data, and maintain it in a pd.df. including >10000 patients, >100000 blood test data
  2. using XGBoost to build a decision tree model, to predict if a patient has AKI from his/her general info and historical blood test data. with >98% accuracy
  3. using socket to read real-time blood testdata from simulator, predict simultaneously, and page to the hospital with low latency.
  4. build docker image; write unit test, integration test, validation module; run and test automatically.
  5. pushed docker image to Azure Kubernetes. add recovery mechanisms (store and reload csv files)
  6. use prometheus and alertmanager to generate metrics, send alerts automatically.

Run Docker Locally

  • Dockerfile: --local=True

Assume the simulator will run outside of Docker:

python simulator.py

Build Docker image:

docker build -t cw3 .

Set Docker environment variables for running:

docker run -e MLLP_ADDRESS=host.docker.internal:8440 -e PAGER_ADDRESS=host.docker.internal:8441 -p 8000:8000 cw3

View localhost:8000 for metrics.

Kubernetes

Login to Azure:

az login

Login to Azure Container Registry (ACR):

az acr login --name 

Build Docker image for Linux x86-64 platform:

docker build --platform=linux/x86-64 -t  .

Push Docker image to ACR:

docker push 

Delete existing Kubernetes deployment:

kubectl delete deployment aki-detection -n 

Apply Kubernetes configuration:

kubectl apply -f kubernetes/deployment.yaml

To see logs:

kubectl logs --namespace= -l app=aki-detection -n 

To check port:

kubectl get pods -n 

To forward Prometheus to local port (then access via http://localhost:8000) or simply access http://172.166.8.31:9090:

kubectl -n  port-forward {port_name} 8000:8000

To deploy alerting rules, first apply the alert rule yaml

kubectl apply -f kubernetes/alerting-rules.yaml

Then restart prometheus server to fetch the newest alerting_rules

kubectl delete deployment prometheus -n 
kubectl apply -f kubernetes/prometheus-deployment.yaml

Acknowledgment

  • This is a Group Project Done by Olivia, Tammy, Iqbal, and Tony. During course 70102 'Software Engineering for Machine Learning Systems' @ ICL
  • All resources came from Andrew Eland, DoC, Imperial College London

aki_detection's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.