View source: R/SOptim_PerformanceEval.R
kappaSingleClass | R Documentation |
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).
kappaSingleClass(obs, pred)
obs |
Integer vector with observed values (class labels, tipically 0 or 1). |
pred |
Numeric with predicted probabilities. |
This function will calculate the Kappa value from 0 to 1 with intervals of 0.01. The maximum value is returned.
A list with two elements:
values A data frame containing the thresholds and the calculated Kappa values;
maxKappa The maximum Kappa value.
obs<-sample(c(0,1),100,replace = TRUE)
pred<-runif(100,0,1)
kappaSingleClass(obs,pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.