This function computes the leverage scores for a given object It uses the concept of sketching and random projections. The function provides an approximation to the leverage scores using a scalable method suitable for large matrices.
LeverageScore(object, ...)
# S3 method for default
LeverageScore(
object,
nsketch = 5000L,
ndims = NULL,
method = CountSketch,
eps = 0.5,
seed = 123L,
verbose = TRUE,
...
)
# S3 method for StdAssay
LeverageScore(
object,
nsketch = 5000L,
ndims = NULL,
method = CountSketch,
vf.method = NULL,
layer = "data",
eps = 0.5,
seed = 123L,
verbose = TRUE,
...
)
# S3 method for Assay
LeverageScore(
object,
nsketch = 5000L,
ndims = NULL,
method = CountSketch,
vf.method = NULL,
layer = "data",
eps = 0.5,
seed = 123L,
verbose = TRUE,
...
)
# S3 method for Seurat
LeverageScore(
object,
assay = NULL,
nsketch = 5000L,
ndims = NULL,
var.name = "leverage.score",
over.write = FALSE,
method = CountSketch,
vf.method = NULL,
layer = "data",
eps = 0.5,
seed = 123L,
verbose = TRUE,
...
)
A matrix-like object
Arguments passed to other methods
A positive integer. The number of sketches to be used in the approximation. Default is 5000.
A positive integer or NULL. The number of dimensions to use. If NULL, the number of dimensions will default to the number of columns in the object.
The sketching method to use, defaults to CountSketch.
A numeric. The error tolerance for the approximation in Johnson–Lindenstrauss embeddings, defaults to 0.5.
A positive integer. The seed for the random number generator, defaults to 123.
Print progress and diagnostic messages
VariableFeatures method
layer to use
assay to use
name of slot to store leverage scores
whether to overwrite slot that currently stores leverage scores. Defaults to FALSE, in which case the 'var.name' is modified if it already exists in the object
Clarkson, K. L. & Woodruff, D. P. Low-rank approximation and regression in input sparsity time. JACM 63, 1–45 (2017). https://dl.acm.org/doi/10.1145/3019134;