Covariate Shift Detection (Classifier Two-Sample Test)
Covariate shift detection by a classifier two-sample test trains a model to distinguish new rows from reference rows and tests whether its out-of-fold AUC exceeds what permuted labels produce, complemented by a kernel MMD test.
분류기 기반 2표본 검정을 이용한 공변량 이동 탐지는 새 자료와 기준 자료를 구분하는 모형을 학습시켜 교차적합 AUC가 라벨을 섞었을 때보다 큰지 검정하고, 커널 MMD 검정으로 보완하는 방법입니다.
The customers scored this quarter may differ from the ones my model was trained on; how can I test whether the input data have shifted and which variables changed?
이번 분기에 점수를 매긴 고객이 모형을 학습한 고객과 다를 수 있는데, 입력 자료가 달라졌는지와 어떤 변수가 바뀌었는지 어떻게 검정하나요?
Label reference rows 0 and new rows 1, fit a classifier with cross-fitting and compare its AUC with AUCs obtained after shuffling the labels. An AUC clearly above 0.5 with a small permutation p value means the feature distributions differ, and the classifier's importances and per-feature standardised differences show where.
When to use Covariate Shift Detection (Classifier Two-Sample Test)
- You have a reference sample (training data) and a new sample with the same features.
- Shift may involve combinations of features that univariate tests miss.
- You want importance weights to reweight reference data toward the new population.
When to use something else
- You monitor a time-ordered stream of errors; use concept drift detectors such as DDM or ADWIN.
- You only need a quick univariate summary per feature; use the population stability index.
Assumptions and requirements
- The group column has exactly two values: reference and new.
- Rows are independent within each sample.
- Importance weights are unreliable where the new data fall outside the reference support.
What the analysis reports
- Out-of-fold AUC with permutation p value
- Feature importance, standardised mean difference, KS statistic and univariate AUC
- Density-ratio importance weights (mean, maximum, effective sample size)
- Kernel MMD statistic with permutation p value
How to report it
A [classifier] separated [value] new from [value] reference rows with out-of-fold AUC = [value] (permutation p = [value]); the kernel MMD^2 was [value], p = [value], and [feature] contributed most to the shift.
Related methods
- Population Stability Index and Data Drift
- Maximum Mean Discrepancy Test
- Kolmogorov-Smirnov Two-Sample Test
How this method is validated
이 방법의 검증 근거
- Automated tests. Checked by automated run tests; no external reference comparison is recorded yet.
자동 시험. 자동 실행 시험을 거칩니다. 외부 참조값과 대조한 기록은 아직 없습니다.
Run Covariate Shift Detection (Classifier Two-Sample Test) on Quorant
- Data you need
- a table (CSV or Excel) with predictor (feature) columns and a grouping variable
- Price
- 250 credits for one analysis up to 10,000 rows (complexity level 2); larger or wider data costs more. Optional methodologist review: 1200 credits.
- Checking
- Automated run tests; no external reference comparison yet
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.