MyNixOS website logo
Description

Aggregate Multiple ROC Curves into One Global ROC.

Aggregates multiple Receiver Operating Characteristic (ROC) curves obtained from different sources into one global ROC. Additionally, it’s also possible to calculate the aggregated precision-recall (PR) curve.

ROCaggregator

Aggregates multiple Receiver Operating Characteristic (ROC) curves obtained from different sources into one global ROC. Additionally, it’s also possible to calculate the aggregated precision-recall (PR) curve.

Motivation

The ROC and the AUC (Area Under the Curve) can be essential metrics when evaluating a model. In situations where there is a parallelization of the model development, such as federated learning, it becomes relevant to obtain precise measures for these metrics. These approaches usually produce partial results that require aggregation methods to get the complete picture. The ROCaggregator appears in this context, allowing to compute the precise ROC curve from the partial results.

Installation

You can install the released version of ROCaggregator from CRAN with:

install.packages("ROCaggregator")

Example

Check the complete example provided in the vignette.

Obtain the global ROC curve from different sources by providing: - the false positive rate (fpr) - true positive rate (tpr) - thresholds (thresh) - the total number of negative samples/control - the total number of samples from each source

library(ROCaggregator)

y1 <- c(1, 0, 1, 1, 0, 0, 0, ...)
# false positive rate values for each threshold
fpr_1 <- c(0, 0, 0, 0, 0.002, ...)
# true positive rate values for each threshold
tpr_1 <- c(0, 0.004, 0.008, 0.012, 0.016, ...)
# thresholds used
thresh_1 <- c(0.9994038, 0.9986345, 0.99847864, 0.99575908, 0.99567612, ...)
# count the number of negative labels
negative_count_1 <- sum(y1 == 0)
# total number of labels
total_count_1 <- length(y1)
...
# ROC curve
roc <- roc_curve(
  list(fpr_1, fpr_2, ...),
  list(tpr_1, tpr_2, ...),
  list(thresh_1, thresh_2, ...),
  c(negative_count_1, negative_count_2, ...),
  c(total_count_1, total_count_2, ...)
)

# Precision-recall
pre_recall <- precision_recall_curve(
  list(fpr_1, fpr_2, ...),
  list(tpr_1, tpr_2, ...),
  list(thresh_1, thresh_2, ...),
  c(negative_count_1, negative_count_2, ...),
  c(total_count_1, total_count_2, ...)
)
Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows