Skip to contents

ARD NMF quickly finds the optimal rank for an NMF model using an exponentially variable learning rate and basic coordinate descent.

Usage

ard_nmf(
  A,
  n_replicates = 3,
  tol = 1e-05,
  maxit = 100,
  verbose = 1,
  L1 = 0.01,
  L2 = 0,
  threads = 0,
  test_density = 0.05
)

Arguments

A

sparse matrix (ideally variance-stabilized) of data for genes x cells (rows x columns)

n_replicates

number of random test sets

tol

tolerance of the fit (1e-5 for publication quality, 1e-3 for cross-validation)

maxit

maximum number of iterations

verbose

no output (0/FALSE), rank-level output (1/TRUE) and step size info (2) and individual model fitting updates (3)

L1

L1/LASSO penalty to increase sparsity of model

L2

L2/Ridge penalty to increase angles between factors

threads

number of threads for parallelization across CPUs, 0 = use all available threads

test_density

fraction of values to include in the test set