So, what is machine learning?

Machine learning for humans — math-free practical machine learning guide that makes sense. Part 1.

Danqing Liu
Aug 23, 2017 · 5 min read

Welcome to machine learning (for humans)! This is a series in which we explore machine learning concepts, techniques, and tools in plain English. You won’t find any maths here — while formulas are what powers computations, we believe why machine learning works should make intuitive sense.

In this very first post, we will lay the foundation by answering the most fundamental question of machine learning, namely what it is and why we need it. If you already know the answer and are here for more advanced stuff, you may swiftly move to the next post. :)

What is machine learning?

A program is a piece of code that takes some input, processes it, and produces some output. For example, a calculator program may take two numbers as its input, add them together, and return the sum as its output.

def calculator(a, b):
return a + b

Most programs like the calculator above are fixed. We predefine some rule (addition), and they simply follow (2+3=5). In contrast, machine learning refers to programs that are dynamic. Instead of upfront rules, we give them a goal and some general guidelines to hit it. Then we let them try to hit the goal, learn how far they missed, make adjustments and try again, hoping that they will get closer over time. This process is called machine learning because it mimics how we learn new skills as humans. For instance, when learning to shoot a basketball, our goal is to let the ball go through the basket, and we have some general directions (throw the ball towards the basket), but the right force to apply at different positions can only be learned through trial-and-error.

Let’s consider a practical example. Say we have a coin and want to predict how many heads we will get if we flip it 10 times. Obviously, our best blind guess is 5 — the chance of head for a fair coin is 50%. If we write a program, it looks like:

def guess_number_of_heads():
return 5

Now let’s actually throw the coin. First 10 throws, 8 heads. Next 10 throws, 8 heads. Next 10 throws, still 8 heads. Oops, it looks like an unfair coin! As humans, we would quickly learn from this and tell ourselves, okay, I will guess a larger number from now on, maybe 8.

How do we let the program do the same? Well, we can write another program that returns 8, but that obviously doesn’t generalize well. If we get a new coin, we need to throw that coin many times ourselves, and then write another program for it. Also, 80% may not even be the real ratio for this coin — it’s possible that after 1000 throws we have 700 heads and 300 tails.

Introducing machine learning. The goal is to make a guess closest to reality. Just like how we learn as humans, we let the program make a guess, tell it the actual outcome, and let it adjust by moving the guess towards the actual outcome. Intuitively, the more flips it has seen, the more confident it should be about its guess, and additional observations should influence it less. Therefore, weighted average is a good way of making the adjustment. The program looks like the following:

Congrats! We’ve just written our very first machine learning program. As you can see, the more flips we do, the closer our predictor gets to the value 8. Now we can give it any coin, and it will learn to make the best prediction for that coin!

Why do we need machine learning?

From the above, we see that machine learning has the ability to learn from past examples, and derive rules to predict the future. Coin flipping itself may not be something worth predicting, but many real problems are similar. For example, if we were to guess whether a stock will go up or down in the next week, without additional information we can only give a 50/50 guess. However, if we give our program historical data for the past year, it can learn to make a much more reasonable prediction, just like what we did above.

Many problems can be solved only with machine learning. One example is facial recognition. There are 7 billion (and growing!) faces on Earth, so it’s clearly impossible to write a non-ML program to recognize all of them. Moreover, “how someone looks” is very hard to convey even to other humans. We have to let computers learn this themselves. As it turns out, neural networks (whoa, fancy term!) are very good at learning such things. We will discuss them in depth in the next article.

Some common real-world problems machine learning is solving right now:

  • Classification: Is the fruit an orange or an apple?
  • Regression: What will the world’s population be in 2050?
  • Optical character recognition (OCR): Google Street View uses this to identify street address numbers.
  • Voice recognition: What are you saying? What is this song?
  • Translation: Think Google Translate.
  • Natural language processing: Hey Siri! — I’m not sure if I understand.
  • Anomaly detection: Is this credit card transaction a fraud?
  • Synthesis: Text-to-speech (Siri). Given a text, produce an audio that sounds human.
  • … and many more.

In subsequent posts, we will be looking at many of the above problems, and understand why machine learning techniques are able to solve them.

That’s it for today! If you liked the post, don’t forget to clap for it. In the next article, we will move on to demystify neural networks. See you next time!

About Us: We are TinyMind, the just-add-water machine learning platform that allows you to train and collaborate on models without buying hardware or maintaining environments. We believe machine learning should be approachable to everyone, from theory to practice.

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade