Description Usage Arguments Value Author(s) Examples
View source: R/multiAdaSampling.R
Performs multiple adaptive sampling to train a classifier model.
1 2 3 4 5 6 7 8 9 10 11 | multiAdaSampling(
data,
label,
reducedDimName = NULL,
classifier = "svm",
percent = 1,
L = 10,
prob = FALSE,
balance = TRUE,
iter = 3
)
|
data |
A dimension reduced matrix from |
label |
A vector of label information for each sample. |
reducedDimName |
A name of the |
classifier |
Base classifier model, either "SVM" ( |
percent |
Percentage of samples to select at each iteration. |
L |
Number of ensembles. Default to 10. |
prob |
logical flag to return sample's probabilities to each class. |
balance |
logical flag to if the cell types are balanced.
If |
iter |
A number of iterations to perform adaSampling. |
A final prediction, probabilities for each cell type and the model are returned as a list.
Pengyi Yang, Taiyun Kim
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(SingleCellExperiment)
# Loading the data
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`.
reducedDim(mat.expr, "matPCs") <- matPCs(mat.expr, assay = "logNorm")
# Here we are using Support Vector Machine as a base classifier.
result <- multiAdaSampling(mat.expr, cellTypes, reducedDimName = "matPCs",
classifier = "svm", percent = 1, L = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.