View source: R/performance_measures.R
| Acc_rnd | R Documentation | 
'Acc_rnd()' computes the expected accuracy of a random classifier based on the class frequencies of the target. This measure can be used as a benchmark when contrasted to the accuracy (in test) of a given prediction model.
Acc_rnd(target, freq = FALSE)
| target | A character vector or a factor. Alternatively, a numeric vector (see below). | 
| freq | TRUE if 'target' contains the frequencies of the classes (in this case, 'target' should be numeric), FALSE otherwise. (Defaults: FALSE). | 
Expected accuracy of a random classification model (a single value).
# Expected accuracy of a random model:
target <- c(rep("a",5),rep("b",2))
Acc_rnd(target)
# This is the same than:
freqs <- c(5/7,2/7)
Acc_rnd(freqs,freq=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.