Skip to content

Introduction to Classification

Regression vs classification

  • Regression: predict a number
  • Classification: predict a label

Often classification models produce probabilities:

  • P(class = 1 | X)

Then apply a threshold to decide the label.

Decision boundary intuition

A classifier learns a boundary that separates classes.

false


  flowchart LR
  X[Features] --> M[Classifier]
  M --> P[Probability scores]
  P --> T[Threshold]
  T --> Y[Predicted label]

false

Binary vs multiclass

  • binary: 2 classes (0/1)
  • multiclass: 3+ classes

Common pitfalls

  • class imbalance
  • wrong metric choice
  • leakage via preprocessing

Mini-checkpoint

Choose a problem and write:

  • classes (labels)
  • cost of false negatives vs false positives
  • best metric for the situation

๐Ÿงช Try It Yourself

Exercise 1 โ€“ Train-Test Split

Exercise 2 โ€“ Fit a Linear Model

Exercise 3 โ€“ Evaluate with MSE

If this helped you, consider buying me a coffee โ˜•

Buy me a coffee

Was this page helpful?

Let us know how we did