Unsupervised ranking of anomaly detection models via cluster-holdout pseudo-labels.
For each detector D, cluster the unlabeled data, hide a subset S of clusters,
train D on the complement, and score points in S as pseudo-anomalies. Then the
ranking of detectors by pseudo-AUC should correlate with their ranking by true AUC
on real anomalies.
Datasets from ADBench (public benchmarks with real labels). Labels are used only to compute the ground-truth ranking; the pseudo-ranking pipeline never sees them. For each dataset we produce a rank correlation (Spearman, Kendall) between pseudo-rank and true-rank, plus top-1 / top-3 hit rates.
src/adrank/pipeline.py— datasets, detectors, clustering, pseudo-eval, aggregationscripts/fetch_adbench.py— downloads ADBench Classical.npzfiles intodata/adbench/scripts/run_v1.py— main experiment runner (parallel across dataset x subset)scripts/aggregate_report.py— Borda / mean-AUC / var-weighted aggregation + correlationsscripts/smoke_test.py— 5-dataset synthetic smoke test (~30 s)
- Latent embedding: PCA to 16 dims (or
difd < 16). - Clustering: MiniBatchKMeans with
K ∈ {30, 50}(sweep). - Cluster-composite anomaly-likeness score:
1/3 * (1 - size/N) + 1/3 * mean-dist-to-k-nearest-centroids + 1/3 * (1 - local-density), each min-max normalized within dataset. - Subset draws:
M = 20per (dataset, K). Each subset targets ~5% ofNas pseudo-anomalies, drawn from the top-quartile of the composite score. Held-out normal fold is 20% of the training complement. - Detectors:
IForest, LOF, KNN, OCSVM, ECOD, COPOD, HBOS, PCA, CBLOF, LODAwith PyOD defaults, fixed seed. - Aggregations reported: Borda-over-ranks, mean pseudo-AUC, variance-weighted mean.
Mean Spearman ρ ≥ 0.6 across ≥ 30 datasets, and top-1 hit-rate ≥ 40% (random baseline ≈ 1/10 = 10%).
- Scrambled pseudo-scores → ρ near 0.
- Trivial "all-same" pseudo-score baseline (mean intra-cluster density, detector-independent) should NOT match the pseudo-ranking's correlation. If it does, the signal is cluster geometry, not detector behavior.
- Random cluster-subset selection (uniform, not composite-weighted) should give strictly lower correlation than the composite-weighted selection — otherwise selection does not matter and we defend the simpler variant.