s.roc | R Documentation |
This function calculates the required points for plotting the ROC curve and the AUC.
s.roc(y, scores, weights = NULL, options = get.options.roc())
y |
A numeric vector ( |
scores |
A numeric vector ( |
weights |
A numeric vector ( |
options |
A list from |
This is generally a statistics helper method in this package and it shows the inner calculations. See AUC section in get.search.metrics for a discussion.
A list with the following items:
n |
Number of observations. |
auc |
Value of AUC. |
points |
Points for plotting ROC. |
y <- c(1, 0, 1, 0, 1, 1, 0, 0, 1, 0)
scores <- c(0.1, 0.2, 0.3, 0.5, 0.5, 0.5, 0.7, 0.8, 0.9, 1)
res1 <- s.roc(y,scores)
costs <- c(1,2,1,4,1,5,1,1,0.5,1)
costMatrix <- matrix(c(0.02,-1,-3,3),2,2)
opt <- get.options.roc(costs = costs, costMatrix = costMatrix)
res2 <- s.roc(y,scores,NULL,options = opt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.