get_mcc: Calculate Matthews correlation coefficient (MCC), F1, etc

View source: R/stats.R

get_mccR Documentation

Calculate Matthews correlation coefficient (MCC), F1, etc

Description

Calculate Matthews correlation coefficient (MCC), F1, etc

Usage

get_mcc(tmpcm)

get_f1(tmpcm)

get_cohens(tmpcm)

Arguments

tmpcm

confusion matrix that follows the default format returned by 'caret::confusionMatrix'

Value

matthews correlation coef value

Functions

  • get_f1: calculate f1 score from confusion matrix

  • get_cohens: calculate Cohen's kappa coefficient from a confusion matrix

Examples

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

stackcon/rngt documentation built on June 17, 2022, 5:29 p.m.