Kappa: Kappa Statistic

Description Usage Arguments Value Author(s) See Also Examples

View source: R/Kappa.R

Description

Kappa estimates the Kappa statistic for model accuracy.

Usage

1
Kappa(mat)

Arguments

mat

a confusion matrix of class 'confusion.matrix' from confusion.matrix

Value

Returns a single value represting the Kappa statistic.

Author(s)

Jeremy VanDerWal jjvanderwal@gmail.com

See Also

auc, omission, sensitivity, specificity, prop.correct, confusion.matrix, accuracy

Examples

1
2
3
4
5
6
7
8
9
#create some data
obs = c(sample(c(0,1),20,replace=TRUE),NA); obs = obs[order(obs)]
pred = runif(length(obs),0,1); pred = pred[order(pred)]

#calculate the confusion matrix
mat = confusion.matrix(obs,pred,threshold=0.5)

#calculate the Kappa statistic
Kappa(mat)

Example output

Warning message:
In confusion.matrix(obs, pred, threshold = 0.5) :
  1 data points removed due to missing data
[1] 0.7826087

SDMTools documentation built on Jan. 11, 2020, 9:23 a.m.

Related to Kappa in SDMTools...