What is Machine Learning?
Posted by: RVSIMSR | Business Analytics
We all would have used an application like Facebook, Flipkart, ERP software etc., at least once in day-to-day life. Have you ever imagined how all this worked? All these applications run with the help of a program that some smart programmers code. One of the most challenging aspects of using a computer is telling the machine in great detail how to do whatever you want to do. But the programmer has developed tools that translate the high level of description into a much more precise format that the computer understands.
Imagine, instead of hiring a programmer to write code for each different problem. What if? "we just write a general program that includes instructions for how to learn from experiences." Later, you can give lots of experiences in the form of examples along the way, often telling them the right and wrong answers. Here, you don't have to write code describing the steps they go through while solving a particular problem. Let this general program figure out the steps from the example they experience. This is what we call machine learning.
Machine Learning: Definition
Let us understand the above lines with a simple analogy: it's like a newborn baby with a general human-like feature who learns everything through experiences and mistakes. With time, he becomes so much so that he starts making all his decisions on his own.
In other words, "Machine learning as a discipline tries to design, understand and use computer programs that learn from experience (i.e. DATA) for the purpose of modelling, prediction, or control".
Machine Learning and Prediction / What is Prediction?
Though machine learning has many applications, its primary uses are in prediction. Hence, let's look at prediction and its type: "Prediction means forecasting any unknown future event or thing."
One kind of prediction is about predicting any future events. for example,
- Whether he/she will default on the loan or not (Credit Assessment).
- How is the market going to change?
- Predicting some medical risk for getting some disease? (Medical Diagnosis).
Second, certain types of prediction problems involve predicting the properties of things, for example (refer to the illustration below). Here, "properties of things" means anticipating detail about any object or thing.
Figure1. machine learning to predict property not yet known
Above mentioned example is much harder to program in a machine because you can't code for all the thousands of available movies by hand, and so it is the case with recognizing pictures as well. But it is much easier for you and me to specify what movie I like? What is a particular image about? we can easily translate from one language to another.
Figure2. machine learning to recognize the pictures
Formulating a Machine Learning Problem
Similar to this, we formulate machine learning problems. First, we give them data and solutions together, enabling machines to learn and experience this example. Later, we provide the problem alone. We let the machine find out the answer from its experience, which we gave earlier as an example. Here as you can see, we are trying to automate the process of finding solutions rather than coding directly.
Now, let us see a few real-time examples of how a prediction problem is formulated and solved using suitable methods. For example, we would try to predict whether we would like the movie or not.
As discussed earlier, you can easily specify movies you like and you don't like. We can write a synopsis of the movie and label them with (+1) if you like the movie and (-1) if you dislike it. To train our machine, we are giving features of movies as data and labels as answers. And now, I want the machine to learn it and predict whether I will like future movies.
Figure3. learning to predict from data
What is Feature Vector / Forming a Feature Vector
So now I train a set of data that includes my preferences concerning the movie. The biggest problem is that the computer does not understand movies, reviews, and all that sort of thing. This is why we need to translate this problem into a format that the computer understands. One way to solve this problem is to convert it into a feature vector form. A Feature Vector is something a computer can handle.
To translate, we can now ask questions about the movie or review, like the movie genre. Who is the lead actor? You can have a fixed number of questions about the movies. Then, tabulate the answers to those questions into vector form with labels. These labels will say whether I like the movie or not. Repeat this process with all the movies in the training dataset.
As we have converted the movie into a labelled vector in the training set, we can follow the same process to translate the movie, which I have not seen yet. But in our testing data, we will have vectors alone, as you can see in the illustration below. The machine will now learn and map from my training set and predict labels based on my taste. Would I like it or not?
Figure4. training data and testing data to predict
How to classify the Data Geometrically?
We can solve the same problem, i.e. classifying movies based on my preferences geometrically as well. As a branch of mathematics, geometry deals with things' size, shape, and angles.
So now, I would take each of those movies as a vector from the training dataset and put them as points in one open space, adding a corresponding label to these points. The exact mechanism, as seen earlier, is implied here, too. We give label data as an example and enable the machine to learn and classify the movie whether I would like it.
Figure5. geometric classification
Linear Separation
Here, the training set just gave us a clue about how a solution might look rather than directly providing a solution. So, we have to find a way to classify these examples. Following the “simplest explanation is best” principle, we divide space into two halves.
Figure6. linear separation
But it does not work, and it doesn’t even work for the training dataset. It is linear separation which has a wrongly classified movie I like to dislike vis-a-vis. Now following the same linear separation, but this time we will change the diagonal. It solves problems nicely, classified liked movies into one bucket, and dislikes in another. Hence, this is a solution that we would select.
Figure7. linear separation on training data
Suppose the data in the training set is well-classified. We can bring movies from test data translated into a vector form and represent them as question marks in space, using this classifier to classify this image.
Figure8. linear separation on testing data
Image Classification examples
Now, let’s look at more realistic problems where we classify images into content categories. We are dealing with very complicated objects, i.e. images. What we are trying to predict is also far more complex.
Figure9. image classification with machine learning
In earlier examples, we had only two categories to predict. Here, we must assign thousands of categories to an image because a single image can present in various forms and shapes.
We can formulate this also into a machine-learning problem precisely in the same way as before. We can give images and the corresponding content category as an example, enabling machines to learn from this example and predict the future content categories of any given image.
The solution is very complicated because it will be tough for humans to specify how to feature images by hand. Computer vision has tried to give computers sight in the past, but this is not how they are learned.
So, the solution to this problem will look similar to how the human visual system processes any image. Eye signals go through a different transformation layer first; you recognize little edges, combinations, and parts. Finally, we get a clear vision of an object. Suppose you use machine learning (or) computer vision to solve this problem. In that case, you have to specify these layers of transformation from a minor feature to parts and combinations by hand. So here, you have to learn what those features are and how they are combined to make that category distinction ultimately.
What is Deep Learning / Better Image Classification through Deep Learning
Today we have a new technique called deep learning, which has overtaken computer vision and machine learning in processing an image. Deep learning is learned entirely from just having those examples of an image with a corresponding category and featurize an image itself without any human intervention.
There are two points that I wish to make here. First: If you look at the below illustration, you will find an error in image processing, but with the help of deep learning, the error has drastically gone down 50-100 % per year in a very short period. Second, suppose you look at the distinction between blue and red in the table. In that case, blue is an older-style computer vision method, and red ones are these deep learning architectures learned entirely from example. And in terms of giving vision to the machine, it has been overtaken by deep learning architecture in the course of just a few years.
Once you solve the image categorization problem and give vision to machines, these will have parallel development in the other related areas, like a self-driving car, robotics. These all interact and take action in the environment. Processing the image and scene in real-time becomes crucial for them.
What is Machine Translation
These developments are not only confined to computer vision, but it goes beyond and changes many areas. One among the many areas is Machine Translation. The Machine Translation problem can be equated to a Machine Learning problem by giving parallel sentences. The training can be like giving more examples of a sentence in one language and giving the same sentence in another language and asking the system to just learn from these examples so that it can be asked later to translate the other sentences from one language to another language. When using curative Google translation, you use this neural machine translation problem method, which is entirely learned from these examples.
One must appreciate the complexity of this kind of problem. The job is not over just by mapping one sentence with the semantic representation; the real complexity lies in predicting much more complex objects like real-time Natural Language sentences.
How do Computers Play Games? / AI (Artificial Intelligence) and Computer Games
The last example of the development in the recent past is the computer playing games against humans. Whenever we hear playing the game with a computer the very first example that comes to our minds is chess. Because that is the only game most of us have seen so far. When played among the individual, one can win by thinking a step ahead of your opponent.
Alpha Go (an online game of Go) defeated the world’s top master-level player and won many championships a decade ago. Because the “Game of GO” is one of the most strategic and ancient games played in China, it is somewhat similar to chess but has 250 moves more than chess at any given point in time, which is a bit more than chess.
It is essential to learn to pay attention to the game board and map that visual description to its actions. This is how AlphaGO deep learning architecture solved this problem. Earlier, we saw one example where we categorized an image into a content category. You can take a picture of a game board, and you can learn to map the image of the game board to those actions you take each time.
Figure10. computer games and AI artificial intelligence
You can learn more by having access to an expert player and what they moved in a particular context. You can make this even more brilliant by having the computer play against itself and incorporating some local search strategies.
It is fascinating to learn about it because it is a 2400-year-old game. One player takes years to master it, but Alpha-Go, with four hours of training, beats a master-level player in seconds. This means AI can do what humans do better. So, it is the right time that we stepped into it.