Baby steps towards machine learning 01- An introduction

Entering to machine learning is confusing; at-least it was for me. The sheer number of topics are overwhelming. I was in a lecture and I heard all these words such as regression, supervised learning, neural networks, classification, markov models, unsupervised learning, priors, transition matrices, etc. I was like ‘whaaaaat !!!!’. Then to make me feel more stupid, one guy in the lecture was using these words like it was everyday stuff, but me; I must admit; I had no clue what so ever even what was the difference between regression and classification. I had no idea which concept belonged to which, or which was a top level field and which were sub fields and so on.

So may be there are others who are in the same situation as I was and this series of articles ‘Baby steps towards machine learning‘ is a simple guide using everyday language to give an overview of how things fit in.

Lets jump in.

Since may be last two three years or so, we hear the two words ‘machine learning’ so frequently and its gradually becoming a familiar topic. The google trend report I generated few minutes ago looks like this.

machine learning trend

Since 2014 or so the interest in machine learning is increasing rapidly. The giants like Google, Microsoft, Facebook and IBM are investing heavily on the subject and related research.

So, naturally,  the first question that rises in mind is ; ‘what the hell is machine learning ?

Even though machine leaning will eventually (and currently also) will play a huge role in artificial intelligence; machine learning is not AI, its a sub part of AI. Machine learning can be thought as one approach of giving AI the ability to take decisions. Lets see this in a simple example.

Say I build a robot. Say the only thing that this robot is suppose to do is when I show it a picture of a cat or a dog it has to say whether its a cat or a dog. Okay, so how do we do it ? One might say we tell it ‘okay if it is small and have four legs its a cat and if its big and have four legs its a dog‘.

This approach is called rule based approach. We are telling the robot some rules which it can use to identify between the two types. But there is a problem. What if its a small dog like a chihuahua, what if the cat is sleeping, what if the dog is standing on two legs or what if the picture doesn’t show the animal’s feet, etc. Okay, we make some more rules, right ? Yes we can, but as we think of more and more scenarios we have to wright more and more rules and at a certain point we realize that things are going to go out of hand. So one might wonder, isn’t there another way ?

Well here comes ‘machine learning’ to the rescue. With machine learning we are not telling the robot the rules, we are letting it define and learn the rules by itself. We might guide it, but we are not writing the rules. So the MACHINE has to LEARN by itself.

Even though I should put a more formal definition here it would only confuse the reader at this stage. With time as we progress we will see more descriptive and valid definitions for machine learning.

Before we go further we need to realize something. With mathematics (except for some fields like statistics) we always get definite answers. One plus One is always Two. But with machine learning we are not looking for a 100% accurate answer. We are looking for a ‘good enough‘ answer.

If my robot can distinguish between cats and dogs pictures with 99.5% accuracy then that is ‘good enough‘. We humans, after decades of living can make wrong decisions, so it is okay for my robot to make mistakes and say ‘ah that’s a cat‘ to a picture of a dog.

So a point to be noted is that we are going for a good enough solution.

Okay now one more thing before we dig bit deeper in to the machine learning world. How does a machine learn ? Well lets check how do we learn. In a computer program things are stored in structures such as arrays and lists. Think of them as buckets. If I write a simple program which can remember the English alphabet, it will store it in an array (a kind of a list of buckets where each bucket is having a character.)

So when I ask it to recite the alphabet it will go from bucket 1 to 26 saying A,B,C,…..,Y,Z. Now if I tell it to recite the alphabet backwards then it will go from bucket 26 to 1 saying Z,Y,….,C,B,A. Both times it will take the same amount of time to recall and recite.

Now if someone tells me to recite the alphabet and then to recite it backwards, reciting it backwards will take a longer time. Why ? because in our brains we are not remembering things using buckets or such partitioned structures, we are learning using patterns. Most of us have our own rhyme of reciting the alphabet. Same with our phone number, when some one asks we can say our phone number quickly because we have learned it and remember it as a pattern. That’s why it takes bit longer for us to recite the phone number backwards.

So if that is how we learn (among other ways), why not teach the machine to learn the same way ? That is what machine learning is about. Letting the machine to figure out patterns in the data we provide it. So ultimately its all about recognizing patterns.

Coming back to our robot, what we want from it is to look at a large number of photos and find out patterns that are unique for cats and that are unique for dogs. When it finds out these patterns we can give it a picture and it will check with its patterns and figure out what is the closest pattern and based on that will decide whether it is a cat or a dog.

At this point we know in simple terms the answer to the question ‘what the hell is machine learning‘. Machine learning is letting the machine find patterns in data so that it can improve its decision making skill as it learns more and more accurate patterns.

In the next baby step we will look in to the three main categories of machine learning, ‘Baby steps towards machine learning 02 – Supervised, Unsupervised and Reinforcement learning


One thought on “Baby steps towards machine learning 01- An introduction

  1. Pingback: Baby steps towards machine learning 02 – Supervised, Unsupervised and Reinforcement learning | The Puddle Jumper

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s