bAccuracy {scReClassify}R Documentation

bAccuracy

Description

This function calculates the accuracy of the prediction to the true label.

Usage

bAccuracy(cls.truth, final)

Arguments

cls.truth

A character vector of true class label.

final

A vector of final classified label prediction from multiAdaSampling.

Value

An accuracy value.

Author(s)

Pengyi Yang, Taiyun Kim

Examples

data("gse87795_subset_sce")

mat.expr <- gse87795_subset_sce
cellTypes <- gse87795_subset_sce$cellTypes

# Get dimension reduced matrix. We are using `logNorm` assay from `mat.expr`.
mat.pc <- matPCs(mat.expr, assay = "logNorm")

# Here we are using Support Vector Machine as a base classifier.
result <- multiAdaSampling(mat.pc, cellTypes, classifier = "svm",
percent = 1, L = 10)

final <- result$final

# Balanced accuracy
bacc <- bAccuracy(cellTypes, final)


[Package scReClassify version 1.0.0 Index]