MLOps
MLOps
This
article is for people who want to understand how an ML model is
deployed to production, the stages, the process, and the tears it
involves.
Let us begin!
What is MLOps?
You must have heard of good old DevOps. The process to build and
deploy software applications. You might wonder how MLOps is
different.
ML Project Lifecycle
ML Infrastructure
ML Code — Now we, come to the actual coding part. In this stage,
we develop a base model, which can learn from the data and predict.
There are tons of ML libraries out there with multiple language
support. Ex: tensorflow, pytorch, scikit-learn, keras, fast-ai and
many more. Once we have a model, we start improving its
performance by tweaking the hyper-parameters, testing different
learning approaches until we are satisfied that the model is
performing relatively better than its previous version.
Analysis Tool — Once your model is ready, how do you know if the
model is performing up to mark. We decide on model analysis in
this stage. How do we compute loss, what error measurement
should we use, how do we check if the model is drifting, is the
prediction result proper, has the model been overfitted or underfit?
Usually, the libraries with which we implement the model ship with
analysis kits and error measurements.
A Walk-through
Jen has a huge pumpkin patch, every year she sells the pumpkins to
townsfolk and local pumpkin spice latte factory. Since she has a
huge demand every year, it became tedious for her to look at every
pumpkin and check if it is good or bad.
MLOps Level-0
Jen is happy.
Classification
Now the demand has begun to rise. You cannot train the model
every day manually. So you create an automation pipeline, to
validate data, prep it, and train the model. You also try to fetch the
best available model, by comparing multiple error metrics. The
pipeline takes care of it all. This process is Level-1 of
MLOps. Here the training and analysis of the model are taken care
of automatically. You just have to check if proper data is available
and make sure there isn’t a skewed dataset so that the model is
trained properly.
MLOps Level-1
MLOps Level-2
Let’s break down the process.
We covered what is MLOps? Why would you use it? What would the
production infrastructure setup look like? And, once you have the
infrastructure, how would you implement it — the process.
You can start by creating simple models and automating the steps.
Remember, it is an iterative process, will take time to get it right.