Clement Vachet
docs: use features as direct input
8ed7e05
|
raw
history blame
935 Bytes

IRIS classification task with AWS Lambda

Workflow: use of AWS lambda function for deployment

Training the model:

bash

python train.py

Building the docker image:

bash

docker build -t iris-classification-lambda .

Running the docker container locally:

bash

docker run --name iris-classification-lambda-cont -p 8080:8080 iris-classification-lambda

Testing locally:

Example of a prediction request

bash

curl -X POST "http://localhost:8080/2015-03-31/functions/function/invocations" -H "Content-Type: application/json" -d '{"features": [[6.5, 3.0, 5.8, 2.2], [6.1, 2.8, 4.7, 1.2]]}'

python

python3 inference_api.py --url http://localhost:8080/2015-03-31/functions/function/invocations -d '{"features": [[6.5, 3.0, 5.8, 2.2], [6.1, 2.8, 4.7, 1.2]]}'

Deployment to AWS

Steps:

  • Pushing the docker container to AWS ECR
  • Creating and testing a Lambda function
  • Creating an API via API Gateway