"ROCR plot()"의 두 판 사이의 차이

27번째 줄: 27번째 줄:
library(ROCR)
library(ROCR)
data(ROCR.simple)
data(ROCR.simple)
pred = prediction( ROCR.simple$predictions, ROCR.simple$labels )
pred1 = prediction( ROCR.simple$predictions, ROCR.simple$labels )
pred2 = prediction(abs(ROCR.simple$predictions + rnorm(length(ROCR.simple$predictions), 0, 0.1)), ROCR.simple$labels)
pred2 = prediction(abs(ROCR.simple$predictions + rnorm(length(ROCR.simple$predictions), 0, 0.1)), ROCR.simple$labels)
perf = performance( pred, "tpr", "fpr" )
perf1 = performance(pred1, "tpr", "fpr")
perf2 = performance(pred2, "tpr", "fpr")
perf2 = performance(pred2, "tpr", "fpr")
plot(perf, colorize = TRUE)
plot(perf1, colorize = TRUE)
plot(perf2, add = TRUE, colorize = TRUE)
plot(perf2, add = TRUE, colorize = TRUE)
</source>
</source>

2020년 5월 10일 (일) 13:21 판

1 개요

ROCR plot()

2 기본형

library(ROCR)
data(ROCR.simple)
pred = prediction( ROCR.simple$predictions, ROCR.simple$labels )
perf = performance( pred, "tpr", "fpr" )
plot( perf )

3 여러 개 겹치기

library(ROCR)
data(ROCR.simple)
pred1 = prediction( ROCR.simple$predictions, ROCR.simple$labels )
pred2 = prediction(abs(ROCR.simple$predictions + rnorm(length(ROCR.simple$predictions), 0, 0.1)), ROCR.simple$labels)
perf1 = performance(pred1, "tpr", "fpr")
perf2 = performance(pred2, "tpr", "fpr")
plot(perf1)
plot(perf2, add = TRUE)

4 알록달록

library(ROCR)
data(ROCR.simple)
pred1 = prediction( ROCR.simple$predictions, ROCR.simple$labels )
pred2 = prediction(abs(ROCR.simple$predictions + rnorm(length(ROCR.simple$predictions), 0, 0.1)), ROCR.simple$labels)
perf1 = performance(pred1, "tpr", "fpr")
perf2 = performance(pred2, "tpr", "fpr")
plot(perf1, colorize = TRUE)
plot(perf2, add = TRUE, colorize = TRUE)
library(ROCR)
data(ROCR.simple)
pred = prediction( ROCR.simple$predictions, ROCR.simple$labels )
perf = performance( pred, "tpr", "fpr" )
par(bg="lightblue", mai=c(1.2,1.5,1,1))
plot(perf, main="ROCR fingerpainting toolkit", colorize=TRUE,
  xlab="Mary's axis", ylab="", box.lty=7, box.lwd=5,
  box.col="gold", lwd=17, colorkey.relwidth=0.5, xaxis.cex.axis=2,
  xaxis.col='blue', xaxis.col.axis="blue", yaxis.col='green', yaxis.cex.axis=2,
  yaxis.at=c(0,0.5,0.8,0.85,0.9,1), yaxis.las=1, xaxis.lwd=2, yaxis.lwd=3,
  yaxis.col.axis="orange", cex.lab=2, cex.main=2)

5 같이 보기

6 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}