Add sedi() — Symmetric Extremal Dependence Index for binary classification#630
Add sedi() — Symmetric Extremal Dependence Index for binary classification#630SimonDedman wants to merge 2 commits intotidymodels:mainfrom
Conversation
…ation Prevalence-independent skill metric that remains reliable at extreme class imbalance (< 2.5%) where j_index (TSS) and mcc degrade. Based on Ferro & Stephenson (2011), recommended by Wunderlich et al. (2019). Includes sedi(), sedi_vec(), data.frame/table/matrix methods, full roxygen docs, 18 tests, NEWS entry, and pkgdown listing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hello @SimonDedman 👋 Before I do a full review, can you explain to me whether this metric only works on binary classification or if it works with any number of outcome classes? |
|
Hi @EmilHvitfeldt ! Binary only - sensitivity and false alarm rate (F = 1 − specificity) are inherently binary from the 2×2 confusion matrix. The original papers are Ferro & Stephenson 2011 & Wunderlich et al. 2019. This implementation enforces binary only: Cheers! |
SEDI now supports macro, macro-weighted, and micro averaging for multiclass classification problems. Each class is treated as a binary one-vs-all problem; per-class SEDI values are averaged. Macro (unweighted) is the default, preserving SEDI's prevalence independence across classes with varying frequencies. - Remove binary-only restriction - Add sedi_multiclass() with one-vs-all decomposition - Support macro, macro_weighted, and micro estimators - Add 6 new multiclass tests (3-class macro/weighted/micro, auto-selection, bounds, prevalence independence) - Update roxygen docs with Multiclass section - Update NEWS.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Also - just pushed a commit extending
The estimator auto-selects All 22 tests pass (6 new multiclass tests covering macro, macro-weighted, micro, auto-selection, bounds, and multiclass prevalence independence). |
Summary
sedi()andsedi_vec(): a prevalence-independent skill metric for binary classificationj_index()(TSS) andmcc()degradeMotivation
Species distribution modelling, rare disease detection, fraud detection, and extreme weather forecasting routinely deal with prevalence below 2.5%. At these levels:
j_index) converges to the hit rate alone and loses discriminatory power (Wunderlich et al. 2019)SEDI is increasingly recommended in the ecological modelling literature as a replacement for TSS at low prevalence, but has no implementation in tidymodels, requiring users to compute it manually from sensitivity and specificity.
References
Test plan
event_level = "second"equivalence🤖 Generated with Claude Code