symNMF: Perform Symmetric Non-negative Matrix Factorization

View source: R/RcppExports.R

symNMFR Documentation

Perform Symmetric Non-negative Matrix Factorization

Description

Symmetric input matrix X of size n \times n is required. Two approaches are provided. Alternating Non-negative Least Squares Block Principal Pivoting algorithm (ANLSBPP) with symmetric regularization, where the objective function is set to be \arg\min_{H\ge0,W\ge0}||X-WH||_F^2+ \lambda||W-H||_F^2, can be run with algo = "anlsbpp". Gaussian-Newton algorithm, where the objective function is set to be \arg\min_{H\ge0}||X-H^\mathsf{T}H||_F^2, can be run with algo = "gnsym". In the objectives, W is of size n \times k and H is of size k \times n. The returned results will all be n \times k.

Usage

symNMF(
  x,
  k,
  niter = 30L,
  lambda = 0,
  algo = "gnsym",
  nCores = 2L,
  Hinit = NULL
)

Arguments

x

Input matrix for factorization. Must be symmetric. Can be either dense or sparse.

k

Integer. Factor matrix rank.

niter

Integer. Maximum number of symNMF interations. Default 30

lambda

Symmetric regularization parameter. Must be non-negative. Default 0.0 uses the square of the maximum value in x.

algo

Algorithm to perform the factorization, choose from "gnsym" or "anlsbpp". Default "gnsym"

nCores

The number of parallel tasks that will be spawned. Only applies to anlsbpp. Default 2

Hinit

Initial right-hand factor matrix, must be of size n x k. Default NULL.

Value

A list with the following elements:

  • W - the result left-hand factor matrix, non-empty when using "anlsbpp"

  • H - the result right hand matrix.

  • objErr - the objective error of the factorization.

References

Srinivas Eswar and et al., Distributed-Memory Parallel Symmetric Nonnegative Matrix Factorization, SC '20, 2020, 10.5555/3433701.3433799


RcppPlanc documentation built on April 15, 2025, 1:11 a.m.