Skip to content
mlmentorship

Domain adaptation

Transfer a model across related but shifted data distributions without assuming unlabeled target data makes the problem identifiable.

Published · 4 min read ·Specialist ·Intermediate

Visual quick review

Visual first · depth when needed

Distinguish covariate, label, and concept shift by the joint-distribution factor that changes, then decide whether unlabeled target inputs contain enough evidence to adapt.

Preparing the visual…

Summary

Training on one distribution and deploying on a related but shifted one is the normal case, not the exception: a fraud model meets new fraud, a medical model meets a new hospital’s scanner, a speech model meets a new accent. Domain adaptation transfers a predictor from a source distribution to a target where the label space is usually the same but the inputs, prevalences, or input-label relationship have moved. The first job is to name which of those moved, because that decides whether the problem is even solvable from the data you have.

Shift types

  • Covariate shift: changes while is stable.
  • Label shift: changes while is stable.
  • Concept shift: changes; unlabeled target data alone is generally not enough.

Naming the assumed shift determines which correction is defensible.

Learning objective: distinguish covariate, label, and concept shift by the factor that changes, then decide whether unlabeled target inputs contain enough evidence to adapt.

Assumption map

What changed, what stayed fixed, and what can target inputs reveal?

Evidence available under three kinds of dataset shift Three rows compare source and target distributions. Under covariate shift, P of X changes while P of Y given X stays fixed, so unlabeled target X can support density-ratio weighting when source and target inputs overlap. Under label shift, P of Y changes while P of X given Y stays fixed, so unlabeled target X plus an identifiable source confusion matrix can estimate target class priors. Under concept shift, P of Y given X changes. The same unlabeled target X is compatible with multiple target labeling rules, so target labels or additional structural assumptions are required. ASSUMED SHIFT DISTRIBUTION FACTORS changed / fixed EVIDENCE COVARIATE P(X) changes input mix moves CHANGED P(X) FIXED P(Y | X) target X helps density-ratio weights, if support overlaps LABEL P(Y) changes class mix moves CHANGED P(Y) FIXED P(X | Y) target X + identifiable source confusion matrix helps CONCEPT P(Y | X) changes label rule moves CHANGED P(Y | X) target P(X) alone cannot reveal it need labels or additional structure
Read it this way: read each row from left to right. A correction is justified only after naming both the factor that changed and the one assumed fixed. Target inputs can expose a changed input mix and, with identifiability conditions, a changed class mix; they cannot reveal a new label rule by themselves. Original synthesis checked against Sugiyama et al. (2007), Lipton et al. (2018), and Ben-David et al. (2010).

Approaches

  • Importance weighting under a covariate- or label-shift assumption
  • Fine-tuning on a small labeled target set
  • Feature alignment with a discrepancy or adversarial objective
  • Self-training with confidence and calibration controls
  • Domain-specific normalization or adapters
  • Robust optimization across the environments you can observe

Evaluation

Use a true target-domain holdout and report the slices that matter. Validate calibration, not just ranking or accuracy, and measure negative transfer: adaptation can help the aggregate while hurting a target subgroup or eroding source performance.

In an interview

  1. Define source, target, labels, and how much target supervision you have.
  2. State the shift assumption.
  3. Establish source-only and target-labeled baselines.
  4. Pick the simplest method the evidence justifies.
  5. Monitor drift and collect the labels that distinguish concept shift from covariate shift.

Common confusions

  • “Align the feature distributions and the task transfers.” Alignment can mix classes or erase the predictive structure you needed.
  • “Unlabeled target data solves domain shift.” Not when the label relationship itself changed.
  • “Fine-tuning always helps.” A small, biased target set can cause negative transfer and calibration failure.

Related: cross-validation strategies, epistemic versus aleatoric uncertainty, and calibration.