Skip to contents

Only the last index of each run of tied scores becomes a vertex, so the trapezoid sum equals the Mann-Whitney statistic. Same numbers as morie_geron_auc_roc(), different construction – the two are each other's independent check.

Usage

morie_geron_auc_roc_trapezoid(y_true, y_scores, pos_label = 1)

Arguments

y_true

Binary labels.

y_scores

Decision scores.

pos_label

Positive-class label.

Value

List with auc, fpr, tpr, thresholds, n_pos, n_neg.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_auc_roc_trapezoid(V, V)
#> $auc
#> [1] 0
#> 
#> $fpr
#> [1] 0.0000000 0.1428571 0.2857143 0.4285714 0.5714286 0.7142857 0.8571429
#> [8] 1.0000000 1.0000000
#> 
#> $tpr
#> [1] 0 0 0 0 0 0 0 0 1
#> 
#> $thresholds
#> [1] Inf   8   7   6   5   4   3   2   1
#> 
#> $n_pos
#> [1] 1
#> 
#> $n_neg
#> [1] 7
#> 
#> $estimate
#> [1] 0
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Area under the ROC curve (trapezoid rule)"
#>