care confustion amterix detection code example Example: confusion matrix caret package r confusionMatrix(data = test_set$pred, reference = test_set$obs)