Skip to content

Compute binary precision, recall, specificity and F1 for the positive class - #64

Merged
ielbadisy merged 1 commit into
mainfrom
fix-binary-class-metrics
Nov 14, 2026
Merged

ielbadisy merged 1 commit into
mainfrom
fix-binary-class-metrics

Conversation

@ielbadisy

Copy link
Copy Markdown
Owner

For a binary outcome these metrics were macro-averaged over both classes, so recall and specificity both equalled balanced accuracy and compare() showed identical values for every model. They now default to the positive class (second factor level, or positive). A new average = c("binary", "macro") argument keeps macro averaging available; multiclass outcomes are always macro-averaged. balancedaccuracy() is unchanged (macro recall). Additive API change, with tests.

@ielbadisy
ielbadisy merged commit 7720f5a into main Nov 14, 2026
@ielbadisy
ielbadisy deleted the fix-binary-class-metrics branch November 14, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant