To understand how to use Machine Learning Models (ML) effectively, we should first understand what these models do. How are they created? And then, what does it mean to put a model in production?
What is a Machine Learning Model?
Machine Learning models are special algorithms that enable computers to answer certain types of questions. There are many different types of algorithms for different scenarios. Some of them are good (accurate) for specific scenarios but not others. To make it simple, the use cases can be broadly generalised as below:
- ‘How much’ and ‘how many’ questions (regression): How much will the house be worth in three years?
- ‘Type of object’ questions (classification): What class does an object belong to?
- Grouping questions (clustering): What are the different groups for this set of objects?
- Finding abnormalities in an object (abnormality detection): Is an image abnormal based on what is defined as normal?
These models are built by data scientists and engineers using tools, frameworks and codes. Yet what is really important in Machine Learning is the fact that all algorithms are built based on what is often a huge amount of data.
Obviously, this is a very simplistic view of the world but fundamentally it is really that simple. To build a model lots data is needed – cleaned, labelled data. Models are built in many iterations via trial and error, tests and measures. There are many steps and processes to follow in order to create a good model. Once it is created, it will enable the computer to answer questions for different cases in a particular situation. This is where the magic (or intelligence) occurs:
We are going to use the created model and find the answers for specific question about different cases. Each model is good for a very specific scenario. For example, is an email spam or not? What is the likelihood that a set of symptoms will be diagnosed as a cold or allergy? And so on…
A Machine Learning (ML) model allows computers to predict with a certain degree of accuracy based on the data that is used to create the models.
The ways in which Machine Learning Models can help us
This is where we need to talk about putting a model in production. This can mean many different things to different companies, people, scenarios, and so on, but the goal is to achieve the following:
- Integrate the model in a systematic way to real batch or on-the-fly cases
- Combine multiple models together to answer complex questions that need multi-step and intermediate answers leading to the next
- Be able to use models in decision making inside an organization, or for customers and consumers
- Integrate the models into workflows and processes that involve multiple participants
- Enable systems (information systems) to use these algorithms as part of their pre-built responsibility with a minimum need to re-deploy or change their code
- Potentially share the model between multiple use-cases using a service call (i.e., analytics as a service).
Of course, being able to monitor and measure the behavior of the models in these live environments is critical as it enables us to improve the behavior of the models. Generally, models on their own are not as useful, unless they are incorporated and become part of the much more sophisticated orchestration in which one of the steps involves calling to the model for some predictions and answers. Then the answers provided by the model should go to a decision model that’s driven with a domain expert’s knowledge (i.e., implemented by business rules).
For instance, in a car insurance scenario, when you want to get insurance for your car, a model will categorize your car based on the likelihood of it being stolen. (e.g., Low, Medium and High). This Machine Learning model is created by the insurance company using their own data sets that detail stolen cars.
So part of calculating the price of an insurance quote for your car might be calling to a Machine Learning model which will identify the likelihood of it being stolen. The result then goes to another part of the process where a price will be calculated, and finally a quote is generated and sent back to you. As illustrated in this example, putting the Machine Learning model into production means incorporating it into the Quote Generation Process which impacts the customer.
As discussed, Machine Learning Models will predict a situation with certain accuracy. However, on their own they cannot deliver much of business value. They are much more useful when integrated as part of a business decision and process. They should be able to be execute requests on-the-fly. Their performance in a specific context must be monitored, measured, and improved over time. In the next post we are going to talk about the different ways to put these models into production.