Machine Learning

Foundations Of Machine Learning

The Three Paradigms

Every ML technique in this entire curriculum falls into one of three paradigms, distinguished by what kind of feedback the learning process receives.

JrCodex·8 min read

Jr Codex ML Notes

Level: Beginner Prerequisites: Chapter 1 Time to complete: ~25 minutes


Table of Contents

  1. The Map of Machine Learning
  2. Supervised Learning
  3. Supervised Learning's Two Branches: Regression & Classification
  4. Unsupervised Learning
  5. Reinforcement Learning
  6. A Side-by-Side Comparison
  7. How This Curriculum Is Organized Around This Map
  8. Summary & Next Steps

1. The Map of Machine Learning

Every ML technique in this entire curriculum falls into one of three paradigms, distinguished by what kind of feedback the learning process receives.

The Three Paradigms, At a Glance
─────────────────────────────────────────
  Supervised Learning:      learns from LABELED examples
                               ("here's the input, here's the
                               CORRECT answer")

  Unsupervised Learning:       finds PATTERNS in UNLABELED data
                                 ("here's the input — find
                                 structure yourself, no answer
                                 key given")

  Reinforcement Learning:         learns from REWARDS resulting
                                     from ACTIONS ("try things,
                                     get feedback on how good the
                                     outcome was, no direct
                                     'correct answer' given")
─────────────────────────────────────────
Visual Map of This Entire Curriculum
─────────────────────────────────────────
              Machine Learning
             /       |         \
      Supervised  Unsupervised  Reinforcement
       /     \        /    \          |
  Regression Classif. Cluster. DimRed.  RL (Module 8)
  (Module 3) (Module 4) (Module 6's two halves)
                 │
          Ensemble Methods
          (Module 5 — techniques
           that BOOST classification
           AND regression algorithms)
─────────────────────────────────────────

2. Supervised Learning

Supervised learning trains a model on data where each example already has the "correct answer" (a label) attached — the model learns to map inputs to these known outputs, so it can predict labels for new, unlabeled inputs.

# Supervised learning ALWAYS has this shape: (input, correct_output) pairs
 
# Example: predicting house prices
training_data = [
    ({"sqft": 1200, "bedrooms": 2}, 250000),      # input features → KNOWN correct price
    ({"sqft": 1800, "bedrooms": 3}, 340000),
    ({"sqft": 2400, "bedrooms": 4}, 410000),
]
 
# The model LEARNS the relationship between features and price,
# then can PREDICT the price for a brand new house it's never seen:
# model.predict({"sqft": 2000, "bedrooms": 3})  →  some predicted price
Terminology You'll See Constantly From Here On
─────────────────────────────────────────
  Features (X):     the input variables (sqft, bedrooms)
  Label/Target (y):    the correct output being predicted (price)
  Training set:           the (features, label) pairs used to
                            teach the model
  Test set:                 held-out (features, label) pairs used
                              to HONESTLY evaluate the trained
                              model (Chapter 5 covers this properly)
─────────────────────────────────────────

3. Supervised Learning's Two Branches: Regression & Classification

Supervised learning splits further, based on what kind of value is being predicted:

Regression                             Classification
─────────────────────────────         ─────────────────────────────
  Predicts a CONTINUOUS NUMBER            Predicts a CATEGORY/CLASS
  (Module 3)                                (Module 4)

  "What will this house SELL FOR?"          "Is this email SPAM or NOT?"
  → $340,250.50 (any real number)             → "spam" (one of a fixed
                                                  set of categories)

  "How many units will we SELL              "Which of these 3 species
   next month?"                                is this flower?"
─────────────────────────────────────────
# Regression: output is a NUMBER, on a continuous scale
def predict_house_price(features) -> float:
    ...      # e.g. returns 340250.50
 
# Classification: output is a CATEGORY, from a fixed, discrete set
def predict_email_category(email) -> str:
    ...      # e.g. returns "spam" or "not_spam"

A quick test to tell them apart: if the answer could sensibly be "342.7" or "$1,204,551.23," it's regression. If the answer must be one of a fixed set of labels ("cat"/"dog"/"bird," or "yes"/"no"), it's classification. This distinction determines which algorithms apply (Modules 3 vs 4) and which evaluation metrics make sense (very different metrics, covered in each module's final chapter).


4. Unsupervised Learning

Unsupervised learning works with data that has no labels at all — no "correct answer" is provided. Instead, the goal is to discover inherent structure, patterns, or groupings within the data itself.

# Unsupervised learning has ONLY inputs — no correct-answer labels at all
customer_data = [
    {"age": 25, "annual_spend": 1200},
    {"age": 52, "annual_spend": 8500},
    {"age": 31, "annual_spend": 1350},
    {"age": 48, "annual_spend": 7900},
    # ... thousands more, with NO pre-existing "correct group" label
]
 
# The algorithm might discover, e.g., that these customers naturally
# form TWO groups (young/low-spend, older/high-spend) — a pattern
# NO ONE explicitly labeled in advance (Module 6 covers this: clustering)
Two Main Unsupervised Tasks (Module 6)
─────────────────────────────────────────
  Clustering:              group similar data points together
                              (e.g. customer segments, Module 6,
                              Ch.1-2)

  Dimensionality Reduction:    compress many features into fewer,
                                 while preserving the important
                                 structure (e.g. visualizing
                                 100-dimensional data in 2D,
                                 Module 6, Ch.3-4)
─────────────────────────────────────────

The absence of labels is the key distinguishing feature: there's no "correct" clustering to check your answer against the way there's a correct house price — success is judged by how useful or coherent the discovered structure turns out to be, a genuinely different evaluation philosophy from supervised learning (revisited in Module 6).


5. Reinforcement Learning

Reinforcement learning (RL) is covered in depth in the AI Notes' dedicated RL module — this curriculum's Module 8 builds directly on that foundation rather than re-deriving it. The core idea, briefly:

RL's Distinct Feedback Signal
─────────────────────────────────────────
  Not labeled examples (supervised) — no one tells the agent
  "the correct action here was X"

  Not just unlabeled data (unsupervised) — the agent takes
  ACTIONS in an ENVIRONMENT and receives REWARDS

  An agent LEARNS, through trial and error, which actions lead
  to good outcomes over time — exactly the framework built in
  the AI Notes' Module 5 (agent types, Markov Decision
  Processes, Q-learning)
─────────────────────────────────────────
# RL's shape: (state, action, reward, next_state) — NOT (input, correct_label)
# An agent playing a game:
#   state = current game board
#   action = a move it tries
#   reward = +1 for winning, -1 for losing, 0 otherwise
#   → learns, over MANY games, which actions tend to lead to reward

Module 8 of this curriculum picks up exactly where the AI Notes' Q-learning chapter left off — covering policy gradient methods, actor-critic algorithms, and the bridge into deep reinforcement learning (which uses neural networks, covered in the Deep Learning Notes, to handle RL problems too large for the tabular methods in the AI Notes).


6. A Side-by-Side Comparison

SupervisedUnsupervisedReinforcement
FeedbackLabeled correct answersNo labels at allRewards from actions
GoalPredict a label for new inputsDiscover structure/patternsLearn a strategy (policy) maximizing reward
Example TaskPredicting house prices, spam detectionCustomer segmentation, data compressionGame-playing, robotics control
This CurriculumModules 3-5Module 6Module 8 (builds on AI Notes)

7. How This Curriculum Is Organized Around This Map

Following This Chapter's Map, Module by Module
─────────────────────────────────────────
  Module 2:    Data Preparation — needed for ALL three paradigms
  Module 3:      Supervised Learning — REGRESSION
  Module 4:        Supervised Learning — CLASSIFICATION
  Module 5:          Ensemble Learning — techniques that BOOST
                       both regression and classification models
  Module 6:            Unsupervised Learning — clustering &
                          dimensionality reduction
  Module 7:              Model Selection & Tuning — applies
                            across supervised techniques
  Module 8:                 Reinforcement Learning — the third
                               paradigm, building on the AI Notes
  Module 9:                    ML in Production — deploying
                                  whatever paradigm you've built
─────────────────────────────────────────

Every module from here forward fits cleanly into this three-paradigm map — when you encounter a new algorithm later in this curriculum, the first useful question is always "which of these three paradigms does this belong to, and why?"


8. Summary & Next Steps

Key Takeaways

  • Machine learning splits into three paradigms based on the type of feedback available: supervised (labeled examples), unsupervised (no labels, find structure), and reinforcement (rewards from actions).
  • Supervised learning further splits into regression (predicting a continuous number) and classification (predicting a category from a fixed set).
  • Unsupervised learning's defining trait is the absence of a "correct answer" to check against — success is judged by usefulness or coherence of discovered structure, not accuracy against a known label.
  • Reinforcement learning is covered in depth in the AI Notes; this curriculum's Module 8 extends that foundation with policy gradients and a bridge to deep RL.

Concept Check

  1. A model predicting "will this customer churn: yes/no" — is this regression or classification, and why?
  2. Why can't unsupervised learning be evaluated the same way as supervised learning (checking predictions against known correct labels)?
  3. What's the key difference in the feedback signal between supervised learning and reinforcement learning?

Next Chapter

Chapter 3: The Machine Learning Workflow


Jr Codex — 1-on-1 Personalized Coaching | Back to Module Index