bAccuracy: bAccuracy

Description Usage Arguments Value Author(s) Examples

View source: R/bAccuracy.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)

SydneyBioX/scReClassify documentation built on Oct. 6, 2021, 5:34 a.m.