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 answer. Here, you don't have to write code describing the steps they have to 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 with experiences and mistakes. With time, he becomes so much so; 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 the area of prediction. Hence let's look at what prediction is 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, types of prediction problems are more about predicting the property of things, for example (refer below illustration). Here "properties of things" means anticipating detail about any object and things.

machine learning to predict property not yet known

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 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.

machine learning to recognize the pictures

Figure2. machine learning to recognize the pictures

Formulating Machine Learning Problem

Somewhat 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. Therefore, we would try to predict whether I 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.

learning to predict from data

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. Here, the biggest problem is that the computer does not understand movies, reviews, and all that sort of things. This is the reason 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. 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? And you can have a fixed number of questions about the movies. Then tabulate the answer 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 if I would like it or not?

training data and testing data to predict

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 the size, shape, and angles of things.

So now I would take each of those movies as a vector from the training dataset and put them as a point in one open space adding a corresponding label with these points. The exact mechanism, as seen earlier, implies here too. We give label data as an example and enable the machine to learn and classify the movie whether I would like it.

geometric classification

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 out which would classify these examples. Following the “simplest explanation is best” principle, we would divide space into two halves.

linear separation

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.

linear separation on training data

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.

linear separation on testing data

Figure8. linear separation on testing data

Image Classification examples

Now, let’s look at some more realistic problems where we will 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.

image classification with machine learning

Figure9. image classification with machine learning

Earlier examples where we had only two categories to predict. Here, we have to assign thousands of different 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.

Here the solution is very complicated because it will be tough for a human to specify how to featurize images by hand. In fact, computer vision tried to give sight to computers in the past, but this is not how these are learned.

So, the solution to this problem will look similar to how the human visual system processes any image. Signals from eyes go through a different transformation layer first; you recognize little edges, then combinations, then 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. And in fact, when you are using curative google translation, you are using this neural machine translation problem method, which is entirely learned from these examples.

One must appreciate the complexity of this kind of problem as the job is not over only by just mapping one sentence with the semantic representation, but the real complexity lies in predicting much more complex objects like real-time Natural Language sentences.

How 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 (online game of go) has 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 categorize 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.

computer games and ai artificial intelligence

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 know about it because it is a 2400-year-old game and 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.

Lets Chat !