Machine Learning Model Deployment
By: Kurtis Pykes
Tags: Innovation, Careers, Artificial Intelligence, Education, Technology

Machine Learning Model Deployment

Source: Become a Machine Learning Engineer Nanodegree

To fully grasp the power of Machine Learning, we ought to learn about the model deployment phase. This phase of the Machine Learning workflow is often left out of the popular Machine Learning courses, leaving many confused about what to do next once they've developed their champion model.

Just to clarify, Machine Learning is leveraged to solve problems by the use of data and improving automatically through experience. For a model to be able to solve problems in the real world it must be able to be accessed and for this to occur it must be effectively deployed into production.

In other words, we maximize the value of Machine Learning models by reliably extracting their predictions and sharing them with other systems.

The Meaning of Model Deployment

Deployment is one of the last stages of the Machine Learning workflow. In this stage, we seek to integrate our machine learning model into a production environment so that it can be used by other software systems to solve the problem it was tasked with solving from its inception.

The Deployment of a Machine Learning Model; Image by Author

When we deploy a Machine Learning model, we are not only talking about the model itself. Model deployment should really be called ML Pipeline deployment for the mere fact we deploy the entire pipeline.

A Machine Learning pipeline simply defines how we codify and automate the machine learning workflow. Typically, it would consist of multiple sequential steps that would allow us to go from retrieving the raw data to a prediction.

We deploy the pipeline because, in both the research and production environment, we are likely to obtain the data in a raw state. In the research environment, we must make the necessary transformations to the data for it to be fed into a Machine Learning model, and in a production environment, we want to replicate the model we developed in the research environment so our results do not vary once the model is in production.

This brings about extremely difficult challenges.

The Challenges of Machine Learning Deployments

Machine Learning projects can fail for a variety of reasons of which include deployment. There are few unique features involved in Machine Learning that make deployment at scale extremely difficult. Here’s a non-exhaustive list of some of the challenges of model deployment:

The Language Barrier

It’s no doubt Python and R are by far the most popular languages used for Machine Learning. While Data Scientists are busy fighting over which language is better, they tend to forget the end goal is to integrate the model as part of a larger system so it could be used to solve problems. This is where the problem arises.

Typically, production systems are built with programming languages other than R or Python (i.e. C++, Java, etc). Porting a Python or R model into a production language is an extremely complicated task, hence the general solution is to recode the model using the production language. This creates 2 problems 1) recoding the model using the production language takes time which is a cost in business and 2) we risk being able to reproduce the research environment that was programmed in Python or R.

Traditional Software Challenges

Machine Learning code is only a small part of a larger software system, hence it can be thought of as a software engineering project which implies Machine Learning projects inherit all of the challenges of traditional software projects. Here’s a few examples of the challenges faced in software projects:

Reliability — The ability of the software to produce the intended result and to be robust to errors

— The ability of the software to produce the intended result and to be robust to errors Reusability — The ability of the software to be used across systems and projects

— The ability of the software to be used across systems and projects Maintainability — The ease with which the software can be maintained

— The ease with which the software can be maintained Flexibility — The ability to add or remove functionality.

Challenges Specific to Machine Learning — Reproducibility

In a Machine Learning context, reproducibility describes the ability of the software to produce the same result when provided with the same input data across systems. This is an extremely important part of Machine Learning hence why I’ll dive deeper into this in a future article.

The Coordination of Various Teams

Machine Learning model deployments involve various teams within an organization. Teams can include Data Scientists (who are responsible for developing the model), Machine Learning Engineers/Software Developers (who are responsible for putting the model into production), and business professionals (who have a good understanding of how the model is going to be used to used in the organization, the problems the model should be solving, and the customers.

The purpose of such diverse teams coming together is to ensure the model is working reliably and ensure the model delivers the intended results.

Wrap Up

Machine Learning model deployment is one of the last stages of the Machine Learning workflow. For whatever reason, it’s often left out of Machine Learning courses which typically tends to leave beginners confused once they’ve built a model that is acceptable for the business problem. Model deployment has its own unique features that make it an extremely challenging task. In future writings, I will hone in further on the reproducibility aspect of the Machine Learning Pipeline as this is a major factor when we want to deploy Machine Learning models.

Thank You for Reading!

If you enjoyed this article, connect with me by subscribing to my FREE weekly newsletter. Never miss a post I make about Artificial Intelligence, Data Science, and Freelancing.

Related Articles