Computes the area under the Receiver Operator Characteristic (ROC) curve.
The AUC can be interpreted as the probability that a randomly chosen positive observation
has a higher predicted probability than a randomly chosen negative observation.

auc(truth, prob, positive, na_value = NaN, ...)

## Arguments

truth |
:: `factor()`
True (observed) labels.
Must have the exactly same two levels and the same length as `response` . |

prob |
:: `numeric()`
Predicted probability for positive class.
Must have exactly same length as `truth` . |

positive |
:: `character(1)`
Name of the positive class. |

na_value |
:: `numeric(1)`
Value that should be returned if the measure is not defined for the input
(as described in the note). Default is `NaN` . |

... |
:: `any`
Additional arguments. Currently ignored. |

## Value

Performance value as `numeric(1)`

.

## Note

This measure is undefined if the true values are either all positive or
all negative.

## References

Youden WJ (1950).
“Index for rating diagnostic tests.”
*Cancer*, **3**(1), 32--35.
doi: 10.1002/1097-0142(1950)3:1<32::aid-cncr2820030106>3.0.co;2-3
.

## See also

Other Binary Classification Measures:
`bbrier()`

,
`dor()`

,
`fbeta()`

,
`fdr()`

,
`fnr()`

,
`fn()`

,
`fomr()`

,
`fpr()`

,
`fp()`

,
`mcc()`

,
`npv()`

,
`ppv()`

,
`tnr()`

,
`tn()`

,
`tpr()`

,
`tp()`

## Examples

#> [1] 0.6666667