Calculate confusion matrix for cross-validation.
Source:R/metapredict_confusion.R
calcConfusionCv.Rd
Calculate a confusion matrix based on predictions from cross-validation.
Usage
calcConfusionCv(
cvFit,
lambda,
ematMerged,
sampleMetadata,
className = "class",
classLevels = NA
)
Arguments
- cvFit
cv.glmnet object from
metapredictCv()
.- lambda
value of lambda at which to use predictions.
- ematMerged
matrix of gene expression for genes by samples.
- 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 incvFit
.