In short

How do you deploy a machine learning model?

Deploying a machine learning model follows a similar workflow wherever it runs: save the trained model, prepare an entry script and an inference configuration, deploy locally to confirm everything works, choose a deployment target, deploy to the cloud and test the resulting web service. Frameworks such as Django REST Framework expose a model through an API endpoint, while managed services such as Amazon SageMaker run the underlying infrastructure.

Workflow for deploying a machine learning model
StepAction
1Save the model
2Prepare an entry script
3Prepare the inference configuration
4Deploy the model locally to check that everything works
5Choose a deployment target
6Deploy the model to the cloud
7Test the resulting web service

Today, Machine Learning (ML) works everywhere. When we interact with banks, shop online, or use social media, Machine Learning (ML) algorithms come into play to ensure an efficient, smooth and secure experience. Machine Learning (ML) and its technology are evolving rapidly, and the features we’ve discovered are just the tip of the iceberg.

Types of Machine Learning (ML): Two Approaches to Learning

Algorithms are the engines that power Machine Learning (ML). In general, two main Machine Learning (ML) algorithms are used today: supervised learning and unsupervised learning. The difference between them is defined by how each learns the data to make predictions.

Supervised Machine Learning (ML)

Supervised Machine Learning (ML) algorithms are the most widely used. The data scientist acts as a guide through this model and teaches the algorithm what conclusions it should reach. The algorithm is trained on datasets that have a pre-labeled and predefined output during supervised learning, just like a child trying to learn fruits by rote from a picture book.

Examples of supervised Machine Learning (ML) include linear and logistic regression algorithms, multi-class classification, and support vector machines.

Unsupervised Machine Learning (ML)

Unsupervised Machine Learning (ML) takes advantage of a more independent approach where the computer learns complex processes and patterns without constant and close guidance by a human. Unsupervised Machine Learning (ML) includes data-driven training with no tags or specific, defined output.

“Workflow for Deploying Models”

Wherever you deploy the model, a similar workflow is used:

  1. Save the model.
  2. Prepare a login script.
  3. Prepare the inference configuration.
  4. Deploy the model locally to make sure everything works.
  5. Select a transaction target.
  6. Deploy the model to the cloud.
  7. Test the resulting web service.


What is the Django REST Framework?

Django is a high–end Python Web Development Framework that encourages rapid development and clean, pragmatic design. It was created by experienced developers and takes care of many Web development challenges. It is also free and open source.

Django REST Framework is a powerful and flexible toolkit for building Web APIs used in Machine Learning (ML) model deployment. With the help of the Django REST Framework, complex Machine Learning (ML) models can be easily exploited by simply calling an API endpoint.

What is the Amazon SageMaker?

This tutorial will teach you how to use Amazon SageMaker to build, train, and deploy a Machine Learning (ML) model. For this exercise, we will use the popular XGBoost ML algorithm. Amazon SageMaker is a fully managed Machine Learning (ML) service that enables developers and data experts to quickly and easily create, train, and deploy Machine Learning (ML) models at any scale.

Getting Machine Learning (ML) models from conceptualization to production is often complex and time–consuming. To train the model, you need to manage large amounts of data, choose the best algorithm for training, manage the computational capacity during exercise, and then deploy the model in a production environment. Amazon SageMaker reduces this complexity by making creating and deploying Machine Learning (ML) models much easier. After selecting the suitable algorithms and frameworks from the wide range of options available, it manages all the underlying infrastructure to train your model at a petabyte-scale and deploy it to production.

You have been asked to develop a Machine Learning (ML) model to predict whether the customer will enroll in a certificate of deposit (CD). This model will be trained on a marketing dataset containing customer demographics, responses to marketing events, and external factors.

For your convenience, the data is labeled, and a column in the dataset identifies whether the customer is registered for a product offered by the bank. This dataset is publicly available in the Machine Learning (ML) repository selected by the University of California, Irvine. This tutorial implements a supervised Machine Learning (ML) model as the data is labeled.

What is the Kubeflow?

Use AKS when you need high–scale production deployments of your Machine Learning (ML) models. Large scale means fast response time,

Questions people ask

What is the difference between supervised and unsupervised machine learning?

Supervised learning trains an algorithm on labeled data with a predefined output, with a data scientist guiding what conclusions it should reach; examples include linear and logistic regression, multi-class classification and support vector machines. Unsupervised learning finds patterns in unlabeled data without close human guidance.

How does Django REST Framework help deploy models?

Django REST Framework is a free, open-source Python toolkit for building web APIs. Wrapping a model in an API lets other applications use even a complex model by calling an endpoint.

Why is moving a model into production difficult?

Teams have to manage large amounts of data, choose the right algorithm, manage computing capacity during training and then deploy into a production environment. Managed machine learning services reduce this work by running the infrastructure for training and deployment.