What is Maximum Mean Discrepancy (MMD) for drift detection?
hardAnswer
- Kernel-based two-sample test.
- Embed both distributions in RKHS via kernel k.
- = ||||²_H = E[k(x, x')] - 2 E[k(x, y)] + E[k(y, y')].
- Zero iff P = Q.
- Handles high-dimensional data (unlike per-feature KS).
- RBF kernel with median-bandwidth heuristic works well.
- Permutation test for p-value.
- Foundation of modern high-dim drift (embeddings from LLMs / vision models).
Check yourself — multiple choice
- Same as KS
- Kernel two-sample: E[k(x,y)] + E[k(y,y')]; RBF + median heuristic; permutation p-value; foundation for high-dim embedding drift
- Random
- Not real
MMD: kernel two-sample; RBF + permutation; high-dim drift.
#monitoring#data-quality
Practise MLOps & Data Quality
215 interview questions in this topic.
Related questions
- What is data drift and how do you detect it?
- How is concept drift different from data drift?
- What is schema drift and how do you detect it?
- What is label drift and why does it matter?
- How is Population Stability Index (PSI) computed and interpreted?
- Why prefer Jensen-Shannon Divergence over KL for drift?