Skip to content

Latest commit

 

History

History
42 lines (23 loc) · 1.36 KB

README.md

File metadata and controls

42 lines (23 loc) · 1.36 KB

Serving Iris Classifier with FastAPI

Read article: Auto-deploy FastAPI App to Heroku via Git in these 5 Easy Steps

Deploy

Creating a 'Deploy to Heroku' Button

Data

The Iris dataset is a simple, yet popular dataset consisting of 150 observations. Each observation captures the sepal length, sepal width, petal length, petal width of an iris (all in cm) and the corresponding iris subclass (one of setosa, versicolor, virginica).

Usage

Make sure you have Docker installed.

  1. Build the docker container using docker build . -t iris
  2. Generate the docker image using docker run -i -d -p 8080:5000 iris

The input is a JSON with the following fields:

  • sepal_l
  • sepal_w
  • petal_l
  • petal_w

Corresponding values are the measurements in cm.

Example request:

curl 'http://localhost:8080/iris/classify_iris' -X POST -H 'Content-Type: application/json' -d '{"sepal_l": 5, "sepal_w": 2, "petal_l": 3, "petal_w": 4}'

To Test it on Swager please find the string:

{"sepal_l": 5, "sepal_w": 2, "petal_l": 3, "petal_w": 4}