Tune nfeat using cross-validation.

CVTune_nfeat(
  reference,
  assayName = "logcounts",
  phenotypes = NULL,
  YY = NULL,
  ncomp = NULL,
  impScores = NULL,
  center = TRUE,
  scale = FALSE,
  nfeatLimits = c(10, 15000),
  gridSize = 30,
  nfeatV = NULL,
  Kfolds = 5,
  regMethod = "PCA",
  labelCode = "-1,1",
  seed = 5202056,
  Ncores = 1,
  nfeat = NULL
)

Arguments

reference

SingleCellExperiment object.

assayName

Character.

phenotypes

Vector.

YY

Matrix.

ncomp

Integer.

impScores

Matrix.

center

Logic.

scale

Logic.

nfeatLimits

Vector.

gridSize

Integer.

nfeatV

Vector.

Kfolds

Integer.

regMethod

Character.

labelCode

Character.

seed

Integer. The function sets the seed with withr::local_seed(), so the session's random-number state is restored on exit.

Ncores

Integer.

nfeat

Chosen number of features per phenotype, or NULL to choose after the cross-validation. Only an interactive session can choose: the function plots the loss and asks.

Value

A list.