AI Hints
Home›Machine Learning Tutorial›The Big Picture
Machine Learning · Lesson 2 of 85

What Machine Learning Is

Rules versus examples.

⏱ 2 min read▶ Video at 4:55🎓 Free
Watch this lesson in the Machine Learning courseWatch on YouTube ↗Full Machine Learning course

HomeWorth's oldest engineer stops by your desk. Why not just write the rules, the engineer asks. If it has three bedrooms, add this much. If it is near the sea, add that much. It is a fair question, and the answer is the most important idea in this course.

What Machine Learning Is
From the video: What Machine Learning Is
  • A fair challenge
  • Why not write the rules?
  • The most important idea

Two ways to program

In normal programming, you write the rules, and the computer applies them. Think of a spam filter. You would write, if the email says free, mark it as spam. Then another rule, and another, thousands of them. And when spammers change one word, every rule breaks. Machine learning flips this around. You give it examples, and the right answers. The algorithm finds the rules itself, and stores them in a model. When the world changes, you do not rewrite anything. You simply train again, on new examples.

When to use it

So when is machine learning the right tool? Use it when the rules are too many or too hard to write by hand, like recognising a face. Use it when the rules keep changing, like fraud. And use it when you have plenty of examples. Do not use it when a simple rule works. If tax is ten percent, multiply by point one. And do not use it when you have no data, or when a mistake would be dangerous, and you cannot explain why it happened.

Rules too hard to writefaces, voices, prices
Rules keep changingfraud, spam, trends
Plenty of exampleshistory you can learn from
Not when a simple rule workstax is just a sum

Quick check

Let's test that idea. Which of these is a good job for machine learning? A, calculating sales tax. B, sorting names by alphabet. C, predicting which customers will leave next month. D, converting miles to kilometres. Think about it for a moment. The answer is C. The others have exact rules. But nobody can write a formula for why a customer leaves, so we learn it from examples.

Quick check
Which is a good job for machine learning?

Summary

Now you can explain it in one sentence. Normal code turns rules into answers. Machine learning turns examples and answers into rules. Next, you will see the three families of machine learning, and which one HomeWorth needs.

Key takeaways
  • Code: rules give answers
  • ML: examples give rules
  • Use it when rules are hard or changing
Next up: The Three Families — supervised, unsupervised, reinforcement