Skip to content

ROCAUC and Average Precision Metrics - #522

Merged
andrewdalpino merged 6 commits into
3.3from
rocauc
Oct 16, 2026
Merged

andrewdalpino merged 6 commits into
3.3from
rocauc

Conversation

@andrewdalpino

@andrewdalpino andrewdalpino commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Two Probabilistic metrics that measure the area under a curve. ROCAUC measure the areas under the ROC curve and Average Precision measure the area under the precision-recall curve.

@andrewdalpino
andrewdalpino requested review from a team and a balanced review from Copilot October 15, 2026 04:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

All-positive Average Precision inputs and distinct numeric-string class names can produce incorrect scores.

2 open findings
What changed in this PR

Adds ROC AUC and Average Precision to Rubix ML’s probabilistic cross-validation metrics.

Changes:

  • Implements positive-class ranking metrics with tie handling.
  • Adds tests for ranking quality, empty inputs, and integer classes.
  • Documents both metrics and adds navigation links.
File Description
tests/​CrossValidation/​Metrics/​ROCAUCTest.php Tests ROC AUC scoring.
tests/​CrossValidation/​Metrics/​AveragePrecisionTest.php Tests Average Precision scoring.
src/​CrossValidation/​Metrics/​ROCAUC.php Implements rank-based ROC AUC.
src/​CrossValidation/​Metrics/​AveragePrecision.php Implements recall-weighted precision.
mkdocs.yml Adds metric navigation entries.
docs/​cross-validation/​metrics/​rocauc.md Documents ROC AUC usage.
docs/​cross-validation/​metrics/​average-precision.md Documents Average Precision usage.
docs/​cross-validation.md Lists both probabilistic metrics.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/CrossValidation/Metrics/AveragePrecision.php Outdated
Comment thread src/CrossValidation/Metrics/ROCAUC.php
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@samuel-akopyan samuel-akopyan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, the ranking logic and tie handling look correct and I verified the expected values in the test providers by hand. A few small things below.

Comment thread src/CrossValidation/Metrics/ROCAUC.php
Comment thread src/CrossValidation/Metrics/ROCAUC.php
Comment thread docs/cross-validation/metrics/average-precision.md Outdated

@apphp apphp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments

@andrewdalpino
andrewdalpino merged commit 49294af into 3.3 Oct 16, 2026
6 checks passed
@andrewdalpino
andrewdalpino deleted the rocauc branch October 16, 2026 23:04
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.

4 participants