Applying a Machine Learning Process on Humans

Source: Deep Learning on Medium


Machine Learning

Teaching humans instead of machines: An interactive approach to learning machine learning

Go to the profile of Ali Masri
Photo by Ben White on Unsplash

Introduction

Machine learning is undoubtedly one of the hottest topics nowadays. There are plenty of articles that explain what machine learning is and how it affects our lives. But this article…this article is different than any other you’ve come across. Why? Because instead of training machines, I am going to train humans!

To do this, I’m going to put you in place of a machine. You’ll discover machine learning from the eyes of a machine, and you will act like one 🤖.

The process will be as follows: I will ask you some questions, then together we’ll track and evaluate your performance with time. If I’m lucky, you’ll get better and better with experience and time. In order to better grasp the subject, I kindly ask you to participate in this experiment and write down all your answers.

Machine Learning Experiment

Setup

Ready for the experiment? Don’t worry there’s no complex setup needed. All you need is a pen and a paper, or a notepad on your computer. Old school stuff.

I’m going to show a table that contains input numbers, and I want you to predict a value. You might be wondering, how am I supposed to know the value? Well…I don’t know! You tell me, and later I’ll evaluate your answers.

First, you have to follow your intuitions. Then we’ll see how to tune your way of thinking. Let’s begin…

Round 1

Try it! Just assign any predicted value you think is correct.

Take your time…

Done? OK, now I will give you the correct ones:

Notice that I only gave you the correct answer and not the steps to get it.

Since we’re communicating behind the screen, I need your help to evaluate your results. I want you to simply count how many correct values you got out of the total. When you get your number, divide it by the total number of inputs (7 in this case), then multiply it by 100. The result you get will be in percentages. It represents your prediction accuracy.

For example: if you got 2 out of 7, then your accuracy is 28.5%. A top accuracy is 100%, and the worst is 0%.

Got your accuracy? Was it bad? Well, don’t get too down on yourself, it’s only the first round. Analyze the correct answers and you may find how they’re linked to the input. Change your way of thinking accordingly, and let’s try again with another round.

Round 2

Here you go…Good luck!

Hope this time you will get better results.

Done? Here are the correct values for these inputs:

Calculate your accuracy again. How was it? I hope it improved. If not, I ask you again to rethink your calculations inside your head. Look for patterns that might help you. Let’s do one final round.

Round 3

Focus well this time, and don’t forget to use your previous experience (you can review the previous rounds, if necessary).

Good luck…

Ready for the results? I’m positive that you’ve improved.

Check the table and calculate your accuracy again:

What happened here?

The process we’ve followed so far is called supervised learning. I asked you to predict output values while supervising and providing you with the correct answers along the way.

You didn’t know the real mapping from the input to the output. But, with time, experience, and me giving you the correct answers each time, I hope you reached a good estimate of how to map the input values.

Well, the real mapping simply counts the number of rounded spaces inside a number. Therefore, (1, 2, 3, 5, 7) have a value of 0; (4, 6, 9) have a value of 1; and finally, (8) has a value of 2. Any combination of numbers is simply the summation of each number’s value.

It was a mean and an unfair process, I know, but normally this is what we do with computers. We give them a set of inputs and outputs and ask them to learn the mapping.

But why would we do that? Actually, it’s because we usually don’t even know the mapping ourselves. Consider a case of teaching a computer to predict whether an image contains a dog or a cat. We don’t know how to write a function that says whether an image represents dogs or cats. It’s a very complicated process.

Therefore, we load the machine with hundreds or thousands of photos of cats and dogs, and ask it to learn this mapping. A machine will try various calculations and will modify its reasoning based on our given correct values. To know more about how this process is different than normal problem-solving approaches, kindly read this article.

Important Points

There are some important points in our experiment to pay attention to:

  1. Each round we completed is called an epoch in machine learning terms. Normally, we need a lot of iterations on the data in order for the machine to learn the real mapping.
  2. The accuracy we were calculating is one type of what we call metrics. A metric is used by the machine to know how it’s progressing and whether it is following a correct direction or not. We push machines to try for rounds and rounds of training until achieving good evaluation results.
  3. The process you had in mind while answering the questions is called the model. A model takes an input, applies some calculations and reasoning, then predicts an output. The whole objective of machine learning is to come up with a model that achieves good results on an input.
  4. Consider the idea that, instead of giving you a mix of questions and answers, my output was simply a sequence of numbers that repeats itself. This way you’d simply neglect the input and follow the sequence. To solve this, normally we shuffle the data before training.
  5. Something else to consider is that you may simply memorize the output after I give you the correct answers. In this way, you didn’t really learn the mapping from an input to an output. You have just memorized the data. This problem is called overfitting, and there are a lot of techniques to solve it (check this article).
  6. Consider a lazy reader who didn’t put any effort into analyzing this puzzle. This person would randomly give any number for each input. This kind of problem is called underfitting. It represents a lazy model that doesn’t put any effort into learning the real mapping of the data (read more).

There are a lot of other points, but this may push us more towards the technical side. So we’ll stop here, but I hope you grasped some of the more general concepts here.

Final Thoughts

Machine learning is an amazing field. Its concepts are highly intuitive and very fun to learn. I hope you were able to look at it from the eyes of a machine. If you want to know more about this field, I kindly ask you to read my previous articles.

If you enjoyed this article, I would appreciate it if you hit the clap button 👏 so it could be spread to others. You can also follow me on Twitter, Facebook, email me directly or find me on LinkedIn.


Did you know: Machine learning isn’t just happening on servers and in the cloud. It’s also being deployed to the edge. Learn more about how Fritz is making this transition possible.

Editor’s Note: Join Heartbeat on Slack and follow us on Twitter and LinkedIn for the all the latest content, news, and more in machine learning, mobile development, and where the two intersect.