kappaSingleClass: Calculate the maximum Cohen Kappa index

View source: R/SOptim_PerformanceEval.R

kappaSingleClassR Documentation

Calculate the maximum Cohen Kappa index

Description

A function used to calculate the maximum value of the Cohen Kappa index when the predicted output is given in probability. This function applies only to single-class problems (e.g., presence/absence of a vegetation type, species).

Usage

kappaSingleClass(obs, pred)

Arguments

obs

Integer vector with observed values (class labels, tipically 0 or 1).

pred

Numeric with predicted probabilities.

Details

This function will calculate the Kappa value from 0 to 1 with intervals of 0.01. The maximum value is returned.

Value

A list with two elements:

  • values A data frame containing the thresholds and the calculated Kappa values;

  • maxKappa The maximum Kappa value.

Examples


obs<-sample(c(0,1),100,replace = TRUE)
pred<-runif(100,0,1)
kappaSingleClass(obs,pred)


joaofgoncalves/SegOptim documentation built on Feb. 5, 2024, 11:10 p.m.