Deploying a machine learning model as an API with Datmo, Falcon, Gunicorn, and Python

@machinelearnbot 

First we'll need to write a function that can take an unclassified entry and perform a prediction on it. To do this, the script will need to rebuild the model in memory based on the pickle file (model.dat, in this case), and feed it a new entry to allow it to make a prediction. While it's possible to retrain a model from scratch each time we want to make a prediction, this is incredibly resource intensive (especially in larger examples) and is a fundamentally different process from making a standalone inference, and as such, is very bad practice in machine learning. I've written a predict function within a new file, predict.py(below), For this prediction, the model requires 4 numerical inputs (sepal_length, sepal_width, petal_length, petal_width -- in this order) and returns a class prediction containing one of three species (Iris-setosa, Iris-versicolor, Iris-virginica).

Duplicate Docs Excel Report

Title
None found

Similar Docs  Excel Report  more

TitleSimilaritySource
None found