Skip to content

bentoml/bentoml-arize-fraud-detection-workshop

Repository files navigation

Credict Card Fraud Detection Service Example

  1. Install dependencies:
pip install -r ./dev-requirements.txt
  1. Download dataset

The dataset could be found on https://www.openml.org/search?type=data&sort=runs&id=42175&status=active It is in arff format.

  1. Train the fraud detection xgboost model. For details, see the https://www.kaggle.com/code/marcelotc/creditcard-fraud-xgboost-example notebook:
./train.sh
  1. Run the ML Service locally:
bentoml serve
  1. Send test requests:

Visit http://localhost:3000/ in a browser and send test requests via the UI.

Alternatively, send test payloads via CLI:

curl -X POST -H "Content-Type: application/json" -d @test.json http://127.0.0.1:3000/predict
  1. Build a docker image for deployment

Build a Bento to lock the model version and dependency tree:

bentoml build

Ensure docker is installed and running, build a docker image with bentoml containerize

bentoml containerize credit_card_fraud_detection:latest

Test out the docker image built:

docker run -it --rm -p 3000:3000 credit_card_fraud_detection:{YOUR BENTO VERSION}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published