evalPerformanceGeneric: A generic function for calculating performance metrics

View source: R/SOptim_PerformanceEval.R

evalPerformanceGenericR Documentation

A generic function for calculating performance metrics

Description

A single wrapper function used to calculate several performance evaluation metrics both for single- or multi-class problems.

Usage

evalPerformanceGeneric(obs, pred, stat, nClassType)

Arguments

obs

Integer vector with observed values (class labels).

pred

Integer vector with predicted values (class labels) or numeric vector with predicted probabilities.

stat

(Character) defining the statistic name ("Kappa", "PSS", "GSS", "AUC" - single-class only or "Accuracy" - multi-class only).

nClassType

(Character) defining the type of classification problem, either: "single-class" or "multi-class".

Value

Numeric with the performance metric value

Examples

obs<-sample(1:5, 100, replace = TRUE)
pred<-sample(1:5, 100, replace = TRUE)
evalPerformanceGeneric(obs, pred, stat = "Kappa", nClassType = "multi-class")


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