Calculates a cross-tabulation of observed and predicted classes with associated statistics
xtab_function(predY, Y)
predY | A vector containing the predictions |
---|---|
Y | A vector containing the true class labels. Must have the same dimensions as ’predY’ |
xtab A list with elements xtab A list with elements: , , ,
table : the results of table on data and reference
positive : the positive result level
overall : a numeric vector with overall accuracy and Kappa statistic values
byClass : the sensitivity, specificity, positive predictive value, negative predictive value, precision, recall, F1, prevalence, detection rate, detection prevalence and balanced accuracy for each class. For two class systems, this is calculated once using the positive argument
Compared to the function caret::confusionMatrix, this function deals with the case where a model assigns all observation to the same class (0 or 1)