Skip to content

Match R cutoff-grid endpoint behavior - #333

Merged
uriahf merged 6 commits into
mainfrom
fix/cutoff-grid-endpoint
Aug 20, 2026
Merged

Match R cutoff-grid endpoint behavior#333
uriahf merged 6 commits into
mainfrom
fix/cutoff-grid-endpoint

Conversation

@uriahf

@uriahf uriahf commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • match R seq(0, 1, by=by) semantics for probability-threshold grids
  • prevent cutoffs from exceeding 1 when by does not divide 1 evenly
  • include 1.0 only when the step lands on it exactly
  • add regression coverage for by=0.3, 0.4, and 0.25
  • verify both binary and time-dependent performance-data paths use the same endpoint behavior

Why

The previous Python implementation used np.arange(0, 1 + by, by), so values such as by=0.3 could produce an invalid cutoff of 1.2. R uses seq(0, 1, by=by), which stops at 0.9 for by=0.3 and includes 1.0 only for steps that land on it (for example by=0.25).

Scope

One shared grid-construction change plus focused tests. No metric formulas, AJ methodology, plotting behavior, schemas, or dependencies are changed.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-20 10:06 UTC

@uriahf uriahf changed the title Keep cutoff grids within probability bounds Match R cutoff-grid endpoint behavior Aug 20, 2026
@uriahf
uriahf marked this pull request as ready for review August 20, 2026 10:06
@uriahf
uriahf merged commit b1453ca into main Aug 20, 2026
4 checks passed
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