R/confusion_matrix.R
confusion_matrix.Rd
Implementation based on https://stackoverflow.com/a/59119854
confusion_matrix(actual_y, predicted_y, labels = NULL, title = NULL)
actual_y | a data frame of the validation labels |
---|---|
predicted_y | a data frame of predicted values with model |
labels | a list of string of confusion matrix labels |
title | a string of the confusion matrix label |
A plot and a dataframe with scoring metrics
#> confusion_matrix$byClass #> Sensitivity 1.0000000 #> Specificity 0.5000000 #> Pos Pred Value 0.5000000 #> Neg Pred Value 1.0000000 #> Precision 0.5000000 #> Recall 1.0000000 #> F1 0.6666667 #> Prevalence 0.3333333 #> Detection Rate 0.3333333 #> Detection Prevalence 0.6666667 #> Balanced Accuracy 0.7500000