-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathROC.R
More file actions
29 lines (19 loc) · 661 Bytes
/
ROC.R
File metadata and controls
29 lines (19 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#############################################
# (c) 2014 Francesco Gadaleta #
#############################################
# ROC curves
# comparison ROC - AUC
library(multtest)
library(ROCR)
data(golub) # 3051 genes and 38 mRNA samples
labels <- golub.cl
gol.true <- factor(golub.cl, levels=0:1, labels=c("ALL", "not ALL"))
gol.pred <- factor(golub[1042,] > 1.07, levels= c("TRUE", "FALSE"), labels=c("ALL", "not ALL"))
table(gol.pred, gol.true)
pred <- prediction(golub[1042,], gol.true)
perf <- performance(pred, "tpr", "fpr")
auc <- performance(pred, "auc")
acc <- performance(pred, "acc")
plot(acc)
plot(perf)
help(performance)