# Machine learning

> Teaching computers by showing them examples instead of writing every rule.

- Level: Basic
- Topics: AI
- URL: https://tidbit.legios.com.ar/machine-learning/
- In Spanish: [Machine learning](https://tidbit.legios.com.ar/es/machine-learning/)

**Machine learning** (ML) is the part of AI where a program learns from examples instead of following rules a person wrote. You give it lots of data where the answer is known, it adjusts itself until it gets those answers mostly right, and then it applies what it learned to new cases it has never seen. The term goes back to 1959, when Arthur Samuel used it for a program that learned to play checkers.

Take a spam filter. Writing rules by hand ('block anything that says FREE MONEY') is endless, because spammers change words faster than you can. With machine learning you collect thousands of emails people already marked as spam or not, and the system learns which combinations of words, senders and links tend to go with spam. When a new email arrives, it gives a probability, not a certainty.

The same recipe is everywhere: predicting which card payment is fraud, which customers might cancel, how long a delivery will take, which movie you will like. Learning from examples has a catch, though: the model can only be as good as its data. If the examples are few, outdated or skewed, the predictions will be too. Deep learning and today's large language models are machine learning at a much larger scale.

## An analogy

Like learning to tell ripe avocados by squeezing hundreds of them with someone who knows, instead of reading a rulebook. After a while you just know, even if you cannot fully explain how.

## Keep in mind

- Learns patterns from examples where the right answer is known.
- Outputs are predictions with a probability, not guarantees.
- Bad, scarce or biased data produces bad predictions.
- Two phases: training builds the model, inference uses it.

## Go deeper

- [Machine learning on Wikipedia](https://en.wikipedia.org/wiki/Machine_learning)
- [Intro to machine learning (Google)](https://developers.google.com/machine-learning/intro-to-ml)

## Related terms

- [Artificial intelligence](https://tidbit.legios.com.ar/artificial-intelligence/): Getting computers to do things that, until recently, only people could do.
- [Spam](https://tidbit.legios.com.ar/spam/): Unwanted messages sent in bulk: ads, scams and junk you never asked for.
- [Deep learning](https://tidbit.legios.com.ar/deep-learning/): Machine learning with many-layered neural networks, behind most recent AI leaps.
- [Training and inference](https://tidbit.legios.com.ar/training-and-inference/): Training builds the model once; inference is using it, millions of times a day.
