generateConfusionMatrix: Generate a confusion matrix

View source: R/SOptim_PerformanceEval.R

generateConfusionMatrixR Documentation

Generate a confusion matrix

Description

A function used to generate a confusion matrix for classification evaluation.

Usage

generateConfusionMatrix(obs, pred)

Arguments

obs

A factor or integer vector with observed values (class labels).

pred

A factor or integer vector with predicted values (class labels).

Value

A matrix object with columns correspoding to observed and rows to predicted values/classes.

Examples

 
obs <- sample(0:1, 20, replace = TRUE)
pred <- sample(0:1, 20, replace = TRUE)
generateConfusionMatrix(obs, pred)


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