pred <- prediction(probs.max, prediction.classes == iris.testing$Species)
##                    REALITY (for us means got correct class!)
##                    1       0                 
##          1        TP      FP         TP/(TP+FP) = accuracy above thr
##  GUESS   0        FN      TN         FN/(TN+FN) = accuracy below thr

##CAN PROB TELL IF WE WILL GUESS RIGHT OR WRONG?
perf = performance(pred, measure = "acc")
plot(perf)
perf = performance(pred, measure = "ppv")
x=rev(unlist(perf@x.values)[-1])
y=rev(unlist(perf@y.values)[-1])
plot(stepfun(x,c(y,1),right=T))

## ACCURACY ABOVE VS ACCURACY BELOW (weird plot)
perf <- performance(pred, measure = "ppv", x.measure = "pcmiss")
plot(perf, colorize=T, print.cutoffs.at=perf@alpha.values, lwd=3,
       text.adj=c(1.2,1.2))

