监督学习在标记示例(将输入与正确输出配对)上训练模型,使其学会预测新输入的输出。它是最常见的 ML 类型,用于分类和回归。理解它会加深 ML 知识。
监督学习如何工作
text
TRAIN on LABELED data (input → known correct output):
1. collect a DATASET of examples with labels (e.g. emails labeled spam/not-spam)
2. split into TRAINING and TEST sets
3. the model learns to map inputs → outputs by minimizing prediction error on training data
4. EVALUATE on the test set (unseen data) → measure how well it generalizes
5. use the trained model to PREDICT outputs for new inputs (inference)
→ learn from examples with answers → predict answers for new cases
分类与回归
text
CLASSIFICATION → predict a CATEGORY (discrete classes):
→ spam/not-spam, cat/dog, disease/no-disease, sentiment (positive/negative)
REGRESSION → predict a continuous NUMBER (value):
→ house price, temperature, demand, age
→ both are supervised (learn from labeled examples); the output type differs
