Compare two NP classification methods at different thresholds.

Share:

Description

compare compares NP classification methods and provide the regions where one method is better than the other. The two NP-ROC curves are required to have the same alpha value sequence as well as having conf = TRUE.

Usage

1
compare(roc1, roc2, plot = TRUE, col1 = "black", col2 = "red")

Arguments

roc1

the first nproc object.

roc2

the second nproc object.

plot

whether to generate the two NP-ROC plots and mark the area of significant difference. Default = 'TRUE'.

col1

the color of the region where roc1 is significantly better than roc2. Default = 'black'.

col2

the color of the region where roc2 is significantly better than roc1. Default = 'red'.

Value

A list with the following items.

alpha1

the alpha values where roc1 is significantly better than roc2.

alpha2

the alpha values where roc2 is significantly better than roc1.

alpha3

the alpha values where roc1 and roc2 are not significantly different.

confidence

represents the confidence level.

References

Xin Tong, Yang Feng, and Jingyi Jessica Li (2016), Neyman-Pearson (NP) classification algorithms and NP receiver operating characteristic (NP-ROC) curves, manuscript, http://arxiv.org/abs/1608.03109.

See Also

npc, nproc, predict.npc and plot.nproc

Examples

1
2
3
4
5
6
7
8
9
n = 1000
set.seed(1)
x1 = c(rnorm(n), rnorm(n) + 1)
x2 = c(rnorm(n), rnorm(n)*sqrt(6) + 1)
y = c(rep(0,n), rep(1,n))
fit1 = nproc(x1, y, band = TRUE, method = 'lda')
fit2 = nproc(x2, y, band = TRUE, method = 'lda')
v = compare(fit1, fit2)
legend('topleft',legend=c('x1','x2'),col=1:2,lty=c(1,1))