accuracy {StabPerf} | R Documentation |
Calculates accuracy of classifier output, given confusion matrix.
Description
Calculates percentage of true predictions in a confusion matrix.
Usage
accuracy(cmat)
Arguments
cmat |
confusion matrix with true membership in rows classifications in cols. |
Details
Divides number of true predictions by the total number of predictions.
Value
score |
Numeric. Percentage of true predictions. |
Rci
See Also
Examples
model <- load.model("data/model.RData")
data <- loadData("data/dataset.RData")
prediction <- predict(model, data[,1:2])
cmat <- confusion.matrix(data$y[1:2], prediction) # create confusion matrix
accuracy(cmat)
[Package
StabPerf version 0.5
Index]