models.roc()
The ROC curve of a binary model (CAS Monograph 5, section 7.3.1): the
Usage
models.roc(
y,
score,
weights=None,
)true and false positive rates with each distinct score as threshold (a row is positive when its score is at least the threshold), and the area under the curve, ties counting half.
Parameters
y: list of float-
0 or 1.
score: list of floatweights: list of float = None
Returns
dict-
thresholds(descending, frominf),false_positive_rate,true_positive_rateandauc.
Examples
>>> from prospicio.models import roc
>>> roc([0.0, 0.0, 1.0, 1.0], [0.1, 0.4, 0.35, 0.8])["auc"]0.75