get_mcc | R Documentation |
Calculate Matthews correlation coefficient (MCC), F1, etc
get_mcc(tmpcm) get_f1(tmpcm) get_cohens(tmpcm)
tmpcm |
confusion matrix that follows the default format returned by 'caret::confusionMatrix' |
matthews correlation coef value
get_f1
: calculate f1 score from confusion matrix
get_cohens
: calculate Cohen's kappa coefficient from a confusion matrix
cm = matrix(c(20,5, 10,15), nrow = 2, ncol = 2, byrow = TRUE, dimnames = list(c("pos", "neg"), c("pos", "neg"))) get_mcc(cm) # 0.4082483 get_f1(cm) # 0.7272727 get_cohens(cm) # 0.4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.