shap-diversity-ensemble-eval
Analyzing Shapley Additive Explanations to Understand Anomaly Detection Algorithm Behaviors and Their Complementarity — Levy et al. (2026) (arXiv:2602.00208, 2026)
What this evaluates
Probes how well SHAP-based feature attribution divergence correlates with prediction/output diversity across unsupervised anomaly detection algorithms, and quantifies how this explanation-driven diversity impacts the robustness and accuracy of model ensembles.
Datasets
- ADBench subset (16 datasets: anthyroid, breastw, glass, Hepatitis, Lymphography, mammography, PageBlocks, Pima, Stamps, thyroid, vertebral, vowels, WBC, Wilt, wine, yeast) — total ?; splits: train (-1), test (-1)
Metrics
AUCPR (primary) — range: [0, 1]
- Area Under the Precision-Recall Curve, computed on binary predictions versus ground truth labels to handle class imbalance.
ρPS — range: [-1, 1]
- Pearson linear correlation between SHAP value vectors of two models across test instances.
ρNDCG — range: [0, 1]
- NDCG similarity between SHAP feature importance rankings of two models.
ρScores — range: [-1, 1]
- Pearson linear correlation between anomaly score vectors of two models.
J — range: [0, 1]
- Jaccard index between binary anomaly prediction sets of two models.
Mantel correlation (r_M) — range: [-1, 1]
- Statistical correlation between two distance/similarity matrices, assessed via permutation test.
Input / output format
Input: Raw feature vectors (≤20 features) from tabular datasets. Each instance is passed to 14 UAD models to generate anomaly scores and binary predictions, and to Kernel SHAP to compute feature attributions.
Output: Per instance: anomaly score, binary prediction (normal/anomalous), and SHAP feature attribution values. Ensembles output aggregated anomaly scores via rank aggregation, yielding a final AUCPR score on the test set.
Scoring recipe
1. Compute SHAP values per instance using Kernel SHAP (k=50 k-means background).
2. Compute similarity matrices across models:
rho_PS = pearson_corr(shap_m1, shap_m2)
rho_NDCG = ndcg_similarity(rank(shap_m1), rank(shap_m2))
rho_Scores = pearson_corr(scores_m1, scores_m2)
J = jaccard_index(pred_m1, pred_m2)
3. For ensembles (size 3), apply rank aggregation to anomaly scores.
4. Evaluate ensemble performance: aucpr = compute_aucpr(y_true, ensemble_scores)
5. Assess matrix correlation: r_M = mantel_test(matrix_A, matrix_B, n_perm=999)
6. Predict ensemble gain via linear regression on mean individual AUCPR and diversity (1 - rho_PS).
Common pitfalls
- Default anomaly thresholds are used for all models, which may not be optimal for imbalanced datasets and can skew Jaccard/score correlations.
- SHAP approximations via k-means background summarization (k=50) may introduce attribution noise, affecting ρPS and ρNDCG stability.
- Diversity is not universally beneficial; negative correlations with AUCPR occur when a single dominant model exists or datasets are too complex, requiring careful model quality filtering.
Evidence (verbatim from paper)
We computed the four similarity matrices ρPS (linear correlation between SHAP values), ρNDCG (similarity of SHAP feature importance rankings), ρScores (linear correlation between anomaly scores), J (jaccard index between anomaly predictions) for each dataset.
Citation
@misc{levy2026shap,
title={Analyzing Shapley Additive Explanations to Understand Anomaly Detection Algorithm Behaviors and Their Complementarity},
author={Levy et al. (2026)},
year={2026},
note={arXiv:2602.00208}
}
1---2name: shap-diversity-ensemble-eval3description: shap-diversity-ensemble-eval4---56# shap-diversity-ensemble-eval78> Analyzing Shapley Additive Explanations to Understand Anomaly Detection Algorithm Behaviors and Their Complementarity — Levy et al. (2026) (arXiv:2602.00208, 2026)910## What this evaluates1112Probes how well SHAP-based feature attribution divergence correlates with prediction/output diversity across unsupervised anomaly detection algorithms, and quantifies how this explanation-driven diversity impacts the robustness and accuracy of model ensembles.1314## Datasets1516- **ADBench subset (16 datasets: anthyroid, breastw, glass, Hepatitis, Lymphography, mammography, PageBlocks, Pima, Stamps, thyroid, vertebral, vowels, WBC, Wilt, wine, yeast)** — total ?; splits: train (-1), test (-1)1718## Metrics1920- `AUCPR` **(primary)** — range: [0, 1]21 - Area Under the Precision-Recall Curve, computed on binary predictions versus ground truth labels to handle class imbalance.22- `ρPS` — range: [-1, 1]23 - Pearson linear correlation between SHAP value vectors of two models across test instances.24- `ρNDCG` — range: [0, 1]25 - NDCG similarity between SHAP feature importance rankings of two models.26- `ρScores` — range: [-1, 1]27 - Pearson linear correlation between anomaly score vectors of two models.28- `J` — range: [0, 1]29 - Jaccard index between binary anomaly prediction sets of two models.30- `Mantel correlation (r_M)` — range: [-1, 1]31 - Statistical correlation between two distance/similarity matrices, assessed via permutation test.3233## Input / output format3435**Input**: Raw feature vectors (≤20 features) from tabular datasets. Each instance is passed to 14 UAD models to generate anomaly scores and binary predictions, and to Kernel SHAP to compute feature attributions.3637**Output**: Per instance: anomaly score, binary prediction (normal/anomalous), and SHAP feature attribution values. Ensembles output aggregated anomaly scores via rank aggregation, yielding a final AUCPR score on the test set.3839## Scoring recipe4041```python421. Compute SHAP values per instance using Kernel SHAP (k=50 k-means background).432. Compute similarity matrices across models:44 rho_PS = pearson_corr(shap_m1, shap_m2)45 rho_NDCG = ndcg_similarity(rank(shap_m1), rank(shap_m2))46 rho_Scores = pearson_corr(scores_m1, scores_m2)47 J = jaccard_index(pred_m1, pred_m2)483. For ensembles (size 3), apply rank aggregation to anomaly scores.494. Evaluate ensemble performance: aucpr = compute_aucpr(y_true, ensemble_scores)505. Assess matrix correlation: r_M = mantel_test(matrix_A, matrix_B, n_perm=999)516. Predict ensemble gain via linear regression on mean individual AUCPR and diversity (1 - rho_PS).52```5354## Common pitfalls5556- Default anomaly thresholds are used for all models, which may not be optimal for imbalanced datasets and can skew Jaccard/score correlations.57- SHAP approximations via k-means background summarization (k=50) may introduce attribution noise, affecting ρPS and ρNDCG stability.58- Diversity is not universally beneficial; negative correlations with AUCPR occur when a single dominant model exists or datasets are too complex, requiring careful model quality filtering.5960## Evidence (verbatim from paper)6162> We computed the four similarity matrices ρPS (linear correlation between SHAP values), ρNDCG (similarity of SHAP feature importance rankings), ρScores (linear correlation between anomaly scores), J (jaccard index between anomaly predictions) for each dataset.6364## Citation6566```bibtex67@misc{levy2026shap,68 title={Analyzing Shapley Additive Explanations to Understand Anomaly Detection Algorithm Behaviors and Their Complementarity},69 author={Levy et al. (2026)},70 year={2026},71 note={arXiv:2602.00208}72}73```7475- arXiv: 2602.00208