FindParameters: Hyperparameter searching

View source: R/Hyperparameter.R

FindParametersR Documentation

Hyperparameter searching

Description

Perform a grid search across user-specified hyperparameters. Return a combination of hyperparameters that optimize AUPRC or AUROC.

Usage

FindParameters(
  count,
  label,
  method,
  type,
  n_neighbors = NULL,
  min_gene_variability_pctl = NULL,
  n_prin_comps = NULL,
  nfeatures = NULL,
  PCs = NULL,
  nf = NULL,
  includePCs = NULL,
  max_depth = NULL,
  k = NULL,
  d = NULL,
  ntop.cxds = NULL,
  ntop.bcds = NULL,
  n_components = NULL,
  n_top_var_genes = NULL,
  n_iters = NULL
)

Arguments

count

A scRNA-seq count matrix.

label

A vector of doublet annotations.

method

A name of doublet-detection method.

type

"AUPRC" or "AUROC".

n_neighbors

Number of nearest neighbors in KNN classifier (Scrublet).

min_gene_variability_pctl

The top percentile of highly variable genes (Scrublet).

n_prin_comps

Number of principal components used to construct KNN classifer (Scrublet).

nfeatures

Number of highly variable genes (DoubletFinder).

PCs

Number of principal components used to construct KNN classifer (DoubletFinder).

nf

Number of highly variable genes (scDblFinder).

includePCs

Index of principal components to include in the predictors (scDblFinder).

max_depth

Maximum depth of decision trees (scDblFinder).

k

Number of nearest neighbors in KNN classifier (doubletCells).

d

Number of principal components used to construct KNN classifer (doubletCells).

ntop.cxds

Number of top variance genes to consider (cxds).

ntop.bcds

Number of top variance genes to consider (bcds).

n_components

Number of principal components used for clustering (DoubletDetection).

n_top_var_genes

Number of highest variance genes to use (DoubletDetection).

n_iters

Number of fit operations from which to collect p-values (DoubletDetection).

Value

A vector of hyperparameter combinations that maximize "AUPRC" or "AUROC".

Examples

data.list <- ReadData(path = ".../real_datasets")
count.list <- data.list$count
label.list <- lapply(data.list$label, FUN = function(label){
 ifelse(label == 'doublet', 1, 0)
})
count <- count.list$`pbmc-1A-dm`
label <- label.list$`pbmc-1A-dm`
result.parameter.scDblFinder <- FindParameters(count, label, method = 'scDblFinder', type = 'AUPRC',
nf=c(500, 1000, 1500, 2000, 2500),
includePCs=c(3, 4, 5, 6, 7),
max_depth=c(3, 4, 5, 6, 7))


xnnba1984/DoubletCollection documentation built on Dec. 10, 2022, 11:13 a.m.