Skip to content

For this tutorial, we'll create an endpoint that will can predict type of iris plant based on the sepal and petal measures (yes, the classic iris problem with the classic iris dataset). You'll need Python for sure. I'll be using scikit-learn as machine learning library and Flask as the web server. You can use the libraries of your choice (Tensor…

Notifications You must be signed in to change notification settings

julioccelise/ml-model-in-endpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ml-model-in-endpoint

You can find more details about this project in https://devtods.com/how-to-create-an-endpoint-with-a-machine-learning-model---the-basic-way/

For this tutorial, we'll create an endpoint that will can predict type of iris plant based on the sepal and petal measures (yes, the classic iris problem with the classic iris dataset). You'll need Python for sure. I'll be using scikit-learn as machine learning library and Flask as the web server. You can use the libraries of your choice (TensorFlow, PyTorch, Django...) since this post focuses on how to deploy the trained model.

Requirements

You'll need:

python >= 3.8

Installing required libraries

pip install -r requirements.txt

Starting the endpoint

In your terminal/command line, navigate to the endpoint folder and configure the Flask application:

For Mac and Linux

$ export FLASK_APP=app
$ export FLASK_ENV=development

For Windows

> set FLASK_APP=app
> set FLASK_ENV=development

After that, just execute the app:

flask run

The endpoint should start runnning in your local envionment.

Calling the endpoint

You can call the endpoint in way you like, for example using Postman or your custom code. If you dom't have any, I've included a small tester of the endpoint.

In your terminal/command line, navigate to the endpoint folder and run:

python endpoint_tester.py

Please share this repo if you find it useful or feel free to comment here or in the blog post if you have any suggestion to improve my ideas.

About

For this tutorial, we'll create an endpoint that will can predict type of iris plant based on the sepal and petal measures (yes, the classic iris problem with the classic iris dataset). You'll need Python for sure. I'll be using scikit-learn as machine learning library and Flask as the web server. You can use the libraries of your choice (Tensor…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages