Calculate Accurate Precision-Recall and ROC (Receiver Operator Characteristics) Curves
Overview
Accurate calculations and visualization of precision-recall and ROC (Receiver Operator Characteristics) curves. Saito and Rehmsmeier (2015) doi:10.1371/journal.pone.0118432.
- New
format_points()reconstructs per-instance scores and labels from a table of performance values calculated at a set of thresholds - true and false positive rates, or recall and precision - so that a summary table can reachevalmod()andmmdata()after all. The rows between two thresholds become instances that share a score, and the even spreadprecrecalready applies to a tied run is the non-linear interpolation of Davis and Goadrich (2006), so nothing new was needed in the curve code and a complete table round-trips exactly.npandnnare required: rates do not carry the class totals, and the totals also place the chance-level baseline. The interpolation is exact only across a gap one instance wide, so an area read off a coarse table remains an estimate -format_points()says so when it runs, and *Prepare your data* says so at more length. Requested in #6 and #15, and tracked in #32.
Show all changes in 0.24.0Hide the rest of the changes in 0.24.0
- *Prepare your data* replaces its section on what cannot be used as input with one on what a table of summary points can and cannot give you.
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-29
- ERROR12 OK, 1 ERROR2026-09-25
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
Show 4 earlier changesHide 4 earlier changes
- NOTE12 OK, 1 NOTE2026-06-08
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-03-10
Documentation
The repository also keeps web-only articles.
- Help pages
- 36includes a package overview page
- Examples that run
- 82%23 run in a plain check · 5 never run
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 3%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 32
- Median days to close, 50 most recently updated closed PRs
- 21
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
12 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/evalclass/precrec on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-14 · The repository has a site deploy workflow
pkgdown site last built 2026-09-14, before release 0.24.0 (2026-09-15)
Show all practicesHide 3 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-08-29Seen in the repository: .claude, CLAUDE.mdNamed in .Rbuildignore: .claude, CLAUDE.mdCommits: at least 108 crediting it in the message
- Claude Opus 5100 commits · Aug to Sep 2026
Some of these counts are a minimum, because the search stopped before the oldest commits.
Dependencies
Installing precrec adds 22 packages (11 with compiled code, 22 MB of source tarballs). Heaviest: ggplot2 6.0 MB, data.table 5.7 MB, Rcpp 1.8 MB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.24.0Latest2026-09-15 · current release · diff ↗ ·
added 12 exports
auc_boot, auc_delong, auc_diff, average_precision, best_cutoff, classification_report, format_points, metric_curve, metric_table, prbe, prob_metrics, prob_metrics_ci - RR 4.6.0 released · 2026-04-24
- 0.14.52025-05-15 · diff ↗
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 0.14.42023-10-12 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.14.22023-03-12 · diff ↗
- 0.14.12023-01-08 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.12.92022-03-10 · diff ↗
- 0.12.82022-01-31 · diff ↗
- 0.12.72021-05-31 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 0.12.52021-04-06 · diff ↗
- 0.12.12021-02-02 · diff ↗
Show 24 earlier eventsHide 24 earlier events
- 0.12.02021-01-07 · diff ↗
- 0.11.22020-05-28 · diff ↗
- 0.11.12020-05-15 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 0.11
- RR 3.6.0 released · 2019-04-26
- 0.10.12019-04-12 · diff ↗
- 0.102019-03-05 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 0.9.1
- 0.8.02017-06-23 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 0.7.12017-04-07 · diff ↗
- 0.6.22017-01-18 · diff ↗
- 0.6.12016-11-22 · diff ↗
- 0.5.22016-10-11 · diff ↗
- 0.5.0
- 0.4.02016-06-24 · diff ↗
- RR 3.3.0 released · 2016-05-03
- 0.3.22016-04-13 · diff ↗
- 0.3.12016-03-01 · diff ↗
- 0.2.02015-12-21 · diff ↗
- 0.1.12015-12-04
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2015-12-04
- Total releases
- 28 / 11 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.1
- Bundled data
- 564 KB / 7 files
- Download size
- 954 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("precrec")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.1093/bioinformatics/btw570.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.