run_NMF_tensor: Single view NMF

run_NMF_tensorR Documentation

Single view NMF

Description

Computes NMF on tensorflow using the reticulate framework, uses a non-negative matrix as input

Usage

run_NMF_tensor(
  X,
  ranks,
  method = "NMF",
  n_initializations = 10,
  iterations = 10^4,
  convergence_threshold = 40,
  n_neighbors = 4,
  alpha = 0.1,
  lamb = 10,
  graph = NULL,
  seed = NULL,
  nthreads = 0,
  extract_features = FALSE
)

Arguments

X

Input matrix, should be a non-negative matrix

ranks

numeric vector with ranks to factorize

method

method to use in the factorization, available: "NMF", "GRNMF_SC"

n_initializations

Number of initializations to evaluate

iterations

Maximum number of iterations to run for every initialization

convergence_threshold

The factorization stops, if the convergence test constant for this number of iterations

n_neighbors

for method "GRNMF_SC", the number of neighbors to take into account when building the graph G

alpha

for method "GRNMF_SC", regularization parameter alpha

lamb

for method "GRNMF_SC", regularization parameter lambda

graph

for method "GRNMF_SC", square matrix representing a graph between columns of the input matrix, values correspond to edge weight, if NULL will compute own graph.

seed

Numeric seed to initialize matrices W and H.

nthreads

Number of CPU threads used to perform the NMF decomposition, (in case a GPU is not available). 0 means the system picks an appropriate number.

extract_features

if TRUE performs feature extraction for all f actorization ranks > 2.

Value

A ButchR_NMF object, containg the factorized matrices W and H, along with factorization metrics

Examples

nmf_exp <- run_NMF_tensor(matrix(1:1000, ncol = 10),
                             ranks = 2:5,
                             n_initializations     = 10,
                             iterations            = 10^4,
                             convergence_threshold = 40)
nmf_exp

hdsu-bioquant/ButchR documentation built on Jan. 28, 2023, 6:06 p.m.