다음 코드는 @adibender에서 "하나의 플롯 ROCR에서 여러 ROC 곡선"으로 찍은 것입니다. 이 코드는 부분적으로? plot.performance에서 가져온 것입니다.R : ROCR을 사용하여 여러 가지 다른 색상의 ROC 곡선을 그립니다.
library(ROCR)
data(ROCR.simple)
preds <- cbind(p1 = ROCR.simple$predictions,
p2 = abs(ROCR.simple$predictions +
rnorm(length(ROCR.simple$predictions), 0, 0.1)))
pred.mat <- prediction(preds, labels = matrix(ROCR.simple$labels,
nrow = length(ROCR.simple$labels), ncol = 2))
perf.mat <- performance(pred.mat, "tpr", "fpr")
plot(perf.mat)
위의 코드와 같이 하나의 플롯에서 r 패키지 ROCR을 사용하여 여러 ROC 곡선을 보여주고 싶습니다. 그러나 ROC 커브가 다른 색으로 나타나길 원합니다. 다른 곡선에 다른 색상을 적용하려면 어떻게해야합니까? 미리 감사드립니다.