Supervised Learning
Supervised learning is learning from labeled examples. You show the model input-output pairs, and it learns to map inputs to outputs.
Key Idea: Learn a function f(x) = y from labeled training data, then use it to predict y for new x values.
Two Main Types
Regression
Predict continuous numerical values.
Examples:
- House price: $350,000
- Stock price: $142.50
- Temperature: 23.5°C
Classification
Predict discrete categories or classes.
Examples:
- Email: Spam or Not Spam
- Image: Cat, Dog, or Bird
- Sentiment: Positive or Negative
Popular Algorithms
Linear Regression
RegressionPredict continuous values
Example: House prices, temperature
Logistic Regression
ClassificationBinary classification
Example: Spam detection
Decision Trees
BothRule-based decisions
Example: Loan approval
Random Forest
BothEnsemble of trees
Example: Feature importance
SVM
ClassificationFind optimal boundary
Example: Image classification
k-NN
BothSimilarity-based
Example: Recommendation
Key Takeaway: Supervised learning requires labeled data. The model learns from examples and generalizes to new, unseen data.