healthcareai-r
healthcareai-r copied to clipboard
function for confusion matrix
Create an evaluate method multiclass so that a confusion matrix is printed as a tibble. I think most of the code to do this is already in plot.multiclass_multiclass_df
I had originally thought this might work well under evaluate.multiclass
, but now I don't think so. That function is for returning performance stats of best or all models. I think the correct way to implement this would be as a separate user-facing function that would get a confusion matrix for both binary and multiclass. I'm not sure where this would go in the package or how a user would know to use it.
-
caret::confusionMatrix
has a nice print method but doesn't return a helpful table. - The code in
plot.multiclass_predicted_df
makes a nice tibble but would need its own print method.
Improvement from writing our own might be marginal.