View source: R/SOptim_PerformanceEval.R
gssSingleClass | R Documentation |
A function used to calculate the maximum value of the Gerrity skill score (GSS) 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).
gssSingleClass(obs, pred)
obs |
Integer vector with observed values (class labels, tipically 0 or 1). |
pred |
Numeric vector with predicted probabilities. |
This function will calculate the GSS value from 0 to 1 with intervals of 0.01. The maximum value is returned. This statistic uses all entries in the confusion matrix, so it does not depend on the forecast distribution, and is equitable (i.e., random and constant forecasts score a value of 0). GSS does not reward conservative forecasting but rather rewards forecasts for correctly predicting the less likely categories. Smaller errors are penalized less than larger forecast errors. This is achieved through the use of the scoring matrix.
A list with two elements:
values A data frame containing the thresholds and the calculated GSS values;
maxGSS The maximum GSS value.
obs<-sample(c(0,1),100,replace = TRUE)
pred<-runif(100,0,1)
gssSingleClass(obs,pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.