AIAI Academy

Module 1: Foundations · 3 min read

Machine Learning: How a Computer Learns From Examples

The three types of learning, what a "model" is, and why data quality matters more than almost anything else.

In the previous lesson we saw that the principle of AI is learning from examples instead of receiving rules. Machine learning is the name of the field that deals with how exactly that's done.

Three terms worth knowing

  • Data: the examples. For instance, ten thousand apartments that were sold, with the size, neighborhood, floor and price of each.
  • Model: the formula the system builds from the examples. You feed it the details of a new apartment and it returns a price estimate.
  • Training: the process in which the model guesses, checks how wrong it was, and adjusts itself a little. The process repeats until the errors are small enough.

After training, the model is used on new cases. That stage is called inference. When you send a question to a chatbot, inference is happening, not training.

The three types of learning

1. Supervised learning

The model receives examples with the correct answer: an image labeled "cat," an email labeled "spam," an apartment labeled with the price it sold for. The goal is to learn to predict the answer for new cases. It's the most common type in business: predicting customer churn, credit scoring, fraud detection.

2. Unsupervised learning

There are no answers. The model looks for structure in the data on its own. A classic example: dividing customers into groups by purchasing patterns, without deciding in advance what the groups are. Sometimes a group emerges that nobody had thought of.

3. Reinforcement learning

The model acts in an environment and gets a "score" for the result: points for winning, a penalty for losing. That's how AlphaGo learned to play Go, and how robots are trained. A version of this method is also used to polish chatbots, which we'll expand on in the lesson on how models are trained.

🎬 AI vs Machine Learning · IBM Technology

Data is the product

Machine learning has a well-known rule: garbage in, garbage out. A model is exactly as good as its examples.

  • If most of the apartments in the data are in a big city, the model will estimate apartments in a small town poorly.
  • If the historical decisions it's trained on were biased, the model will learn the bias. Reuters reported in 2018 that Amazon scrapped an experimental résumé-screening tool after discovering it favored male candidates. The reason was that it learned from ten years of hiring in which most hires were men.

That's why much of the work in a real project isn't choosing the algorithm but collecting, cleaning and checking data.

Why "95% correct" isn't always good

A model trained very well on its examples can fail on new examples. This phenomenon is called overfitting: the model memorized the examples instead of understanding the pattern. That's why a model is always tested on data it didn't see during training.

Also, an accuracy percentage alone can mislead. If only 1% of transactions are fraud, a model that says no transaction is fraud is "99% correct" and still worthless.

Bottom line: Machine learning is a process in which a model guesses, errs and corrects itself across many examples. The quality of the examples determines the quality of the result. In the next lesson we'll meet the tool that made this process so powerful: neural networks.

Sources

Read next