Git Product home page Git Product logo

amazon-frauddetector-mlops-multiaccount-cdk's Introduction

ML Ops using AWS Fraud detector

docs/MultiAccountMLOps.png

The Basics

Lets get AWS Fraud detector up and running in a single account first using a Notebook!

This section demonstrates how to train and deploy Amazon fraud detector using Boto3.

Prerequisites

  1. Python 3.6.5 - For more details, see https://www.python.org/downloads/release/python-365/
  2. Setup Virtual env - For more details, see https://docs.python.org/3.6/tutorial/venv.html

Local Setup

  1. Once you have activated your virtual env, install dependencies in the command line

    pip install -r ./src/requirements.txt 
    pip install -r ./tests/requirements.txt
    pip install -r ./requirements_notebook.txt
    
  2. To check if the install & setup works, run the tests in the command line

    export PYTHONPATH=./src
    pytest 
    

Run

See sample code in notebook ReadmeFraudDetector.ipynb. To run on the cli see samples below

Data Transformation

  1. The scaffolding for data transformation code is in src/main_demo_data_transformer.py. To run transformation with sample data
export PYTHONPATH=./src
# get help
python ./src/main_demo_data_transformer.py -h

# sample run
python ./src/main_demo_data_transformer.py --s3desturi s3://mybucket/fraud-demo/

Training

  1. The scaffolding for training code is in src/main_demo_fraud_detector_train.py. To run training with sample data that we created using the transformation step above. Note: A prerequisite is the the roles need to be set up for Fraud detector to run. See infra/README.md on how to set deploy fraud detector role
export PYTHONPATH=./src
# get help
python ./src/main_demo_fraud_detector_train.py -h

# sample run
python ./src/main_demo_fraud_detector_train.py --s3uri s3://mybucket/fraud-demo/train.csv --role <roleArnAssumedByFraudDetectorToAccessS3data> --sampledata "<sample_training_data>"

Deploy Model

  1. The scaffolding for deployment code is in src/main_demo_fraud_detector_deploy.py. To run deploy the model that we created using the training step above
export PYTHONPATH=./src
# get help
python ./src/main_demo_fraud_detector_deploy.py -h

# sample run
python ./src/main_demo_fraud_detector_deploy.py --model sample_model_name --modelVersion 1.0 --detector demo

UnDeploy Model

  1. The scaffolding for undeployment code is in src/main_demo_fraud_detector_undeploy.py. To undeploy a model sample_model_name, version 1.0 and detector demo
export PYTHONPATH=./src
# get help
python ./src/main_demo_fraud_detector_undeploy.py -h

# sample run
python ./src/main_demo_fraud_detector_undeploy.py --model sample_model_name --modelVersion 1.0 --detector demo

MLOps and Multiaccount deployment using CDK

To create a multi-account Codepipeline workflow to deploy Fraud Detector, See ./infra/README.md

docs

Useful resources

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

amazon-frauddetector-mlops-multiaccount-cdk's People

Contributors

amazon-auto avatar cyrilhamidechi avatar elangovana 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.