multiAdaSampling {scReClassify} | R Documentation

## multi Adaptive Sampling function

### Description

Performs multiple adaptive sampling to train a classifier model.

### Usage

    multiAdaSampling(
      data,
      label,
      reducedDimName = NULL,
      classifier = "svm",
      percent = 1,
      L = 10,
      prob = FALSE,
      balance = TRUE,
      iter = 3
    )

### Arguments

`data` | A dimension reduced matrix from `matPCs`.
`label` | A vector of label information for each sample.
`reducedDimName` | A name of the `reducedDim` to use. This must be specified if `data` is a SingleCellExperiment object.
`classifier` | Base classifier model, either "SVM" (`svm`) or "RF" `'rf'` is supported.
`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 `FALSE`, down sample large cell types classes to the median of all class sizes.
`iter` | A number of iterations to perform adaSampling.

### Value

A final prediction, probabilities for each cell type and the model are returned as a list.

### Author(s)

Pengyi Yang, Taiyun Kim

### Examples

    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)

[Package scReClassify version 1.0.0 Index]