measure_kappa: Cohen's kappa

Description Usage Arguments Value See Also Examples

View source: R/measure_kappa.R

Description

This function is based on function 'measureKAPPA' from 'mlr' package.

Usage

1
measure_kappa(truth = NULL, response = NULL, conf_mat = NULL)

Arguments

truth

a vector with true (reference) values.

response

a vector with response (predicted) values.

conf_mat

a table similar to (table(truth, response, useNA = "no")).

Value

[!!!]

See Also

Other measures_: measure_wkappa()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
truth <- rep(1:3, times = 50)
prediction <- rep(3:1, each = 50)

measure_kappa(truth, prediction)

square_matrix <- table(truth, prediction)
measure_kappa(conf_mat = square_matrix)


# # matrix(c("TP", "FN", "FP", "TN"), 2)
#
# make_conf_matrix <- function(TP, FN, FP, TN)
#                  matrix(c(TP, FN, FP, TN), 2)
#

GegznaV/multiROC documentation built on Sept. 15, 2020, 10:33 a.m.