The auc function takes an S3 object generated by part and evalmod and retrieves a data frame with the partial AUC scores of ROC and Precision-Recall curves.

pauc(curves)

# S3 method for aucs
pauc(curves)

Arguments

curves

An S3 object generated by part and evalmod. The pauc function accepts the following S3 objects.

S3 object# of models# of test datasets
sscurvessinglesingle
mscurvesmultiplesingle
smcurvessinglemultiple
mmcurvesmultiplemultiple

See the Value section of evalmod for more details.

Value

The auc function returns a data frame with pAUC scores.

See also

evalmod for generating S3 objects with performance evaluation measures. part for calculation of pAUCs. auc for retrieving a dataset of AUCs.

Examples

################################################## ### Single model & single test dataset ### ## Load a dataset with 10 positives and 10 negatives data(P10N10) ## Generate an sscurve object that contains ROC and Precision-Recall curves sscurves <- evalmod(scores = P10N10$scores, labels = P10N10$labels) ## Calculate partial AUCs sscurves.part <- part(sscurves, xlim = c(0.25, 0.75)) ## Shows pAUCs pauc(sscurves.part)
#> modnames dsids curvetypes paucs spaucs #> 1 m1 1 ROC 0.3771875 0.7543750 #> 2 m1 1 PRC 0.3616708 0.7233417
################################################## ### Multiple models & single test dataset ### ## Create sample datasets with 100 positives and 100 negatives samps <- create_sim_samples(1, 100, 100, "all") mdat <- mmdata(samps[["scores"]], samps[["labels"]], modnames = samps[["modnames"]]) ## Generate an mscurve object that contains ROC and Precision-Recall curves mscurves <- evalmod(mdat) ## Calculate partial AUCs mscurves.part <- part(mscurves, xlim = c(0, 0.75), ylim = c(0.25, 0.75)) ## Shows pAUCs pauc(mscurves.part)
#> modnames dsids curvetypes paucs spaucs #> 1 random 1 ROC 0.0900000 0.2400000 #> 2 random 1 PRC 0.1419725 0.3785933 #> 3 poor_er 1 ROC 0.2855000 0.7613333 #> 4 poor_er 1 PRC 0.3591651 0.9577736 #> 5 good_er 1 ROC 0.3409000 0.9090667 #> 6 good_er 1 PRC 0.3728455 0.9942546 #> 7 excel 1 ROC 0.3747000 0.9992000 #> 8 excel 1 PRC 0.3750000 1.0000000 #> 9 perf 1 ROC 0.3750000 1.0000000 #> 10 perf 1 PRC 0.3750000 1.0000000
################################################## ### Single model & multiple test datasets ### ## Create sample datasets with 100 positives and 100 negatives samps <- create_sim_samples(4, 100, 100, "good_er") mdat <- mmdata(samps[["scores"]], samps[["labels"]], modnames = samps[["modnames"]], dsids = samps[["dsids"]]) ## Generate an smcurve object that contains ROC and Precision-Recall curves smcurves <- evalmod(mdat, raw_curves = TRUE) ## Calculate partial AUCs smcurves.part <- part(smcurves, xlim = c(0.25, 0.75)) ## Shows pAUCs pauc(smcurves.part)
#> modnames dsids curvetypes paucs spaucs #> 1 good_er 1 ROC 0.4281000 0.8562000 #> 2 good_er 1 PRC 0.4507481 0.9014962 #> 3 good_er 2 ROC 0.4447000 0.8894000 #> 4 good_er 2 PRC 0.4249336 0.8498671 #> 5 good_er 3 ROC 0.4054000 0.8108000 #> 6 good_er 3 PRC 0.4395037 0.8790074 #> 7 good_er 4 ROC 0.4523000 0.9046000 #> 8 good_er 4 PRC 0.4492614 0.8985229
################################################## ### Multiple models & multiple test datasets ### ## Create sample datasets with 100 positives and 100 negatives samps <- create_sim_samples(4, 100, 100, "all") mdat <- mmdata(samps[["scores"]], samps[["labels"]], modnames = samps[["modnames"]], dsids = samps[["dsids"]]) ## Generate an mscurve object that contains ROC and Precision-Recall curves mmcurves <- evalmod(mdat, raw_curves = TRUE) ## Calculate partial AUCs mmcurves.part <- part(mmcurves, xlim = c(0, 0.25)) ## Shows pAUCs pauc(mmcurves.part)
#> modnames dsids curvetypes paucs spaucs #> 1 random 1 ROC 0.03120000 0.1248000 #> 2 random 1 PRC 0.13547234 0.5418894 #> 3 poor_er 1 ROC 0.08110000 0.3244000 #> 4 poor_er 1 PRC 0.18968919 0.7587567 #> 5 good_er 1 ROC 0.13360000 0.5344000 #> 6 good_er 1 PRC 0.25000000 1.0000000 #> 7 excel 1 ROC 0.23570000 0.9428000 #> 8 excel 1 PRC 0.25000000 1.0000000 #> 9 perf 1 ROC 0.25000000 1.0000000 #> 10 perf 1 PRC 0.25000000 1.0000000 #> 11 random 2 ROC 0.02570000 0.1028000 #> 12 random 2 PRC 0.10639098 0.4255639 #> 13 poor_er 2 ROC 0.09630000 0.3852000 #> 14 poor_er 2 PRC 0.20149453 0.8059781 #> 15 good_er 2 ROC 0.14300000 0.5720000 #> 16 good_er 2 PRC 0.25000000 1.0000000 #> 17 excel 2 ROC 0.24320000 0.9728000 #> 18 excel 2 PRC 0.25000000 1.0000000 #> 19 perf 2 ROC 0.25000000 1.0000000 #> 20 perf 2 PRC 0.25000000 1.0000000 #> 21 random 3 ROC 0.01410000 0.0564000 #> 22 random 3 PRC 0.08182652 0.3273061 #> 23 poor_er 3 ROC 0.07900000 0.3160000 #> 24 poor_er 3 PRC 0.19737709 0.7895084 #> 25 good_er 3 ROC 0.14640000 0.5856000 #> 26 good_er 3 PRC 0.25000000 1.0000000 #> 27 excel 3 ROC 0.23940000 0.9576000 #> 28 excel 3 PRC 0.25000000 1.0000000 #> 29 perf 3 ROC 0.25000000 1.0000000 #> 30 perf 3 PRC 0.25000000 1.0000000 #> 31 random 4 ROC 0.03430000 0.1372000 #> 32 random 4 PRC 0.14392004 0.5756802 #> 33 poor_er 4 ROC 0.11540000 0.4616000 #> 34 poor_er 4 PRC 0.20184637 0.8073855 #> 35 good_er 4 ROC 0.16280000 0.6512000 #> 36 good_er 4 PRC 0.25000000 1.0000000 #> 37 excel 4 ROC 0.22500000 0.9000000 #> 38 excel 4 PRC 0.25000000 1.0000000 #> 39 perf 4 ROC 0.25000000 1.0000000 #> 40 perf 4 PRC 0.25000000 1.0000000