Korva
Tech

Computers Learn by Studying Old Exams That Include the Answers

Once trained on examples with known results, the system does one of two jobs: guess a number or choose a category.

AI image
Google for Developers · What is Machine Learning?

Think of a student cramming for a final with a stack of old exams that include both the questions and the answers. After working through enough of them, the student is ready for a new exam.

That is how supervised learning works, the most common type of machine learning, in which a person hands the computer data that already includes the known correct results. The computer studies those examples until it learns the pattern that connects the inputs to the right answer.

Once trained, the system takes a new question and makes a prediction. One kind of prediction is called regression, which means guessing a number. A weather model might predict how much rainfall to expect. A real estate model might predict a future house price from the size of the home, its neighborhood, its bedroom and bathroom count, lot size, borrowing costs, property taxes, building expenses, and how many other houses are on the market nearby. A travel model might predict ride time in minutes and seconds from past traffic data, distance, and weather conditions.

The other kind of prediction is called classification, which means deciding which category something belongs in. That could be flagging whether an email is spam or deciding whether a photo contains a cat. The simpler version, called binary classification, chooses between just two options, like rain or no rain. The more elaborate version, called multiclass classification, chooses among more than two, like rain, hail, snow, or sleet.

So if you want to know what a system is doing, look at what its answer looks like. If the answer is a number, it is doing regression. If the answer is a choice, it is doing classification.

Questions people ask

Why does the computer need the correct answers during training?

It needs them to check its own guesses and adjust. By comparing its prediction to the known result over thousands or millions of examples, it gradually finds the mathematical relationship that maps inputs to outputs. Without the answers, it would have no way to tell a good guess from a bad one.

How much training data does supervised learning need?

Usually a lot, and more complex problems need more examples. A house price model must see enough past sales to weigh square footage, neighborhood, interest rates, and other factors. In general, the system improves as it sees more varied examples with reliable answers.

Can the same system do both regression and classification?

A single trained model usually does one or the other, because a number and a category are different kinds of outputs. But the same organization can build both types from similar data. A weather service, for example, might use one model to predict inches of rain and another to predict whether it will rain at all.