Supervised Learning
Learning from labeled examples
Learning from labeled examples
Supervised learning is like having a teacher who grades your homework. You give the model input data along with the correct answers (called labels), and it learns the relationship between them.
Once trained, the model can look at new, unseen inputs and predict the answer on its own. The "supervision" comes from those labeled examples that guide the learning process.
Predicting a number. The output is continuous, like a slider.
e.g. house price, tomorrow's temperature, stock price
Predicting a category. The output is one of a set of labels.
e.g. spam / not spam, cat / dog, positive / negative review
The simplest supervised algorithm. It draws the best-fit line through your data points. If house size goes up, price goes up proportionally. The line captures that relationship.
LINEAR REGRESSION: PREDICTING HOUSE PRICES BY SIZE
A decision tree works like a flowchart of yes/no questions. At each step, it asks the question that best splits the data. Follow the branches and you arrive at a prediction.
DECISION TREE: SHOULD I BRING AN UMBRELLA?
Build many decision trees, each on a random subset of data, then let them vote on the answer. The wisdom of the crowd makes the result more reliable.
"Tell me who your neighbors are, and I'll tell you who you are." To classify a new point, look at the K closest data points and go with the majority.
Supervised learning is the workhorse of machine learning. The model learns from labeled examples so it can make predictions on brand-new data it has never seen before. The better and more representative your training examples, the better the model performs.