Course contentsShow
← Machine Learning and Deep Learning
Lesson 2585 of 3,53856. Few-Shot and Meta-LearningFree lesson

Support Set vs Query Set

Distinguishing between the small labeled support set and the query examples to classify.

Support Set vs Query Set

What you'll learn: How few-shot learning splits data into a small labeled support set for learning and a query set for evaluation.

The Core Distinction

In few-shot learning, each task is organized into two distinct subsets:

Support Set: A small collection of labeled examples that the model uses to quickly adapt or "learn" the new task. In N-Way K-Shot learning, this contains exactly K examples per class across N classes. Think of this as your mini training set for the current task.

Query Set: Unlabeled examples from the same classes that the model must classify after "seeing" the support set. This is your test set for evaluating how well the model generalized from those few support examples.

The Learning Flow

The process works like this:

  1. The model receives the support set (e.g., 5 classes with 1 example each in 5-way 1-shot)
  2. The model adapts its predictions based on these examples
  3. The model then predicts labels for the query set
  4. Performance is measured on the query set

A Practical Analogy

Imagine learning to identify rare birds:

  • Support Set: A field guide showing you 1 photo each of 5 new bird species with their names
  • Query Set: You then go bird-watching and must correctly identify these 5 species in the wild

The support set is your reference material; the query set tests whether you truly learned to distinguish them.

Why This Matters

This separation ensures the model doesn't just memorize the support examples but learns meaningful patterns that generalize. The query set acts as the held-out test data within each episode, measuring true few-shot learning ability.

Key Takeaway: The support set provides the few labeled examples for task adaptation, while the query set evaluates generalization—both are essential components of every few-shot learning episode.