statistics | R Documentation |
statistics
returns the different performance measures and statical values using the function confusionMatrix
and
the package pROC
for the AUC-ROC calculation
statistics(pred, truth, positive, dnn, prevalence, mode)
pred |
factor containing the predicted classes |
truth |
factor containing the reference classes |
positive |
the first level of the factor or the level considered as positive class, if factors are classified as positive and negative classes |
dnn |
dimension names for the table |
prevalence |
prevalence should be a single numeric value since we are using the binary factors |
mode |
specifies either particular statistical values or everything returns all statistical values |
list containing two elements. First element is a list with elements: table (confusion matrix), positive (the level of positive class), overall (overall accuracy and other statistic values) and byClass (the values of different performance measures as specified by the argument mode). Second element is the value: Area under the curve
library(tm) library(plyr) truth <- factor(meta(liu_corpus)$real_label) sam <- meta(liu_corpus)$real_label pred <- factor(sample(sam)) statistics(pred, truth, positive = "1", dnn = c("Prediction", "Truth"), prevalence = NULL, mode = "everything" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.