Applies smoothing and sparsity constraints to a matrix or vector as used in SIMLR or manifold learning, followed by optional L1 feature normalization depending on the energy type.

simlr_sparseness(
  v,
  constraint_type = c("Stiefel", "Grassmann", "none", "ortho"),
  smoothing_matrix = NULL,
  positivity = "positive",
  sparseness_quantile = 0.8,
  constraint_weight = NA,
  constraint_iterations = 1,
  sparseness_alg = "soft",
  energy_type = "acc"
)

Arguments

v

A numeric matrix or vector to be transformed.

constraint_type

Character. Type of manifold constraint; one of `"Stiefel"`, `"Grassmann"`, or `"None"`.

smoothing_matrix

Optional numeric matrix. If provided, v is left-multiplied by this matrix.

positivity

Character positive, negative or either.

sparseness_quantile

Numeric between 0 and 1. Fraction of elements to sparsify using quantile thresholding.

constraint_weight

Numeric. Weight for the constraint, used in orthogonalization.

constraint_iterations

Numeric. Number of iterations for the orthogonalization optimization.

sparseness_alg

Character. Sparsity algorithm to use (relevant for Stiefel and Grassmann). . ensemble or nnorth are test options.

energy_type

Character. If set to one of `"acc"`, `"cca"`, `"nc"`, `"normalized_correlation"`, `"lowRankRegression"`, or `"lrr"`, then the returned matrix is normalized using l1_normalize_features.

Value

A numeric matrix of the same dimensions as v, with applied smoothing, sparsity, and optional normalization.