Skip to contents

Calculate confusion matrices based on predictions for validation datasets.

Usage

calcConfusionValidation(
  predsList,
  lambda,
  sampleMetadata,
  className = "class",
  classLevels = NA,
  each = TRUE
)

Arguments

predsList

list of predictions from metapredict().

lambda

value of lambda at which to use predictions.

sampleMetadata

data.frame of sample metadata.

className

name of column in sampleMetadata containing the true labels.

classLevels

Order of classes in the confusion matrix. If NA (default), then the function uses the order in cvFit.

each

logical indicating whether to calculate a confusion matrix for each validation dataset (default) or one confusion matrix including all datasets.

Value

If isTRUE(each), a list of objects of class table. Otherwise, an object of class table.