multiAdaSampling {scReClassify} | R Documentation |
Performs multiple adaptive sampling to train a classifier model.
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
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)