次のおもちゃのデータセットがあります。
df1<-structure(list(X1 = c(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), X2 = c(0.564666517055852,
0.993248174442609, 0.517237113309667, 0.0128217854167603, 0.952654357126895,
0.958073009436008, 0.860038905846366, 0.425314512801637, 0.809327038447625,
0.985049417726494, 0.165982081954436, 0.517237113309667, 0.00211852090504078,
0.296898500479658, 0.994690775408805, 0.999991149759367, 0.999949243479285,
0.999979994962211, 0.409697759931823, 0.999995828877373, 0.999991594894354,
0.999999834424374, 0.952641245900919, 0.999998774453881, 0.999999777896636,
0.999998864433372, 0.998786297471059, 0.999927421881167, 0.998265361329274,
0.999550929839182, 0.999900216754163, 0.999912135543067, 0.999999924775596,
0.996227950775217, 0.998265981873947, 0.999959584436354, 0.999993039255167,
0.99968139946193, 0.999999997308486, 0.999999458017638, 0.999996417856357,
0.99958403590535, 0.999998891765696, 0.999999624757926, 0.999818190766803,
0.999997979863151, 0.999974432439759, 0.996227950775217, 0.999999771762929,
0.983441425608786, 0.99999843468322)), .Names = c("X1", "X2"), row.names = c(NA,
-51L), class = "data.frame")
Metrics パッケージの auc() 関数を使用すると、スコアが 1 であることがわかります。
> Metrics::auc(df1$X1, df1$X2)
[1] 1
これは正しくないようです。助言がありますか?