What Is Machine Learning?

In ordinary programming, you supply the rules and the computer follows them. Machine learning turns that around. You supply examples — lots of them — and the computer searches for the rule that best explains them. It learns from data instead of being told what to do.

Concretely, "learning" means tuning the knobs of a model until its predictions match the examples as closely as possible. Below is the simplest case of all: the data clearly trend upward, and the machine's job is to find the straight line that fits them best.

Be the algorithm

Adjust the slope and height of the line to make it hug the data. The faint red sticks are the errors — how far each point sits from your line — and the total is shown below. Shrinking that total is exactly what a learning algorithm does, just automatically and far faster than by hand.

Why this matters

Once a model has learned a good rule from past examples, it can make predictions about new ones it has never seen. That's the whole game: learn a pattern from data, then use it on the future. Spam filters, recommendations, medical diagnosis, speech recognition — all are this same loop, scaled up. Everything in this course is a richer version of "find the rule that best fits the examples."