Learn R Programming

bmrm (version 3.3)

roc.stat: Compute statistics for ROC curve plotting

Description

Compute statistics for ROC curve plotting

Usage

roc.stat(f, y)

Arguments

f

decision value for each instance

y

a logical that specify binary labels

Value

a data.frame() that compute for each threshold value 'f' roc curve statistics: TP, FP, TN, FN, FPR, TPR, sensitivity, specificity, precision, recall, accuracy

Examples

Run this code
# NOT RUN {
  x <- cbind(data.matrix(iris[1:4]))
  y <- ifelse(iris$Species=="versicolor","versicolor","not_versicolor")
  w <- bmrm(rocLoss(x,y),LAMBDA=0.01)
  with(roc.stat(x %*% w,y=="versicolor"),plot(FPR,TPR,type="l"))
  with(roc.stat(-x[,2],y=="versicolor"),lines(FPR,TPR,col="blue"))
# }

Run the code above in your browser using DataLab