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

Regression

Predict continuous values

Example: House prices, temperature

Logistic Regression

Classification

Binary classification

Example: Spam detection

Decision Trees

Both

Rule-based decisions

Example: Loan approval

Random Forest

Both

Ensemble of trees

Example: Feature importance

SVM

Classification

Find optimal boundary

Example: Image classification

k-NN

Both

Similarity-based

Example: Recommendation

Key Takeaway: Supervised learning requires labeled data. The model learns from examples and generalizes to new, unseen data.