Learn R Programming

jrSiCKLSNMF (version 1.2.3)

GenerateWmatricesandHmatrix: Initialize the \(\mathbf{W}\) matrices in each modality and the shared \(\mathbf{H}\) matrix

Description

Create the \(\mathbf{W}^v\) matrices and \(\mathbf{H}\) matrix via non-negative double singular value decomposition (NNDSVD) (Boutsidis and Gallopoulus 2008; Gaujoux and Seoighe 2010) or randomization. For randomization, the algorithm runs for 10 rounds for the desired number of random initializations and picks the \(\mathbf{W}^v\) matrices and \(\mathbf{H}\) matrix with the lowest achieved loss.

Usage

GenerateWmatricesandHmatrix(
  SickleJr,
  d = 10,
  random = FALSE,
  numberReps = 100,
  seed = 5,
  minibatch = FALSE,
  batchsize = -1,
  random_W_updates = FALSE,
  subsample = 1:dim(SickleJr@count.matrices[[1]])[2],
  usesvd = FALSE
)

Value

SickleJr An object of class SickleJr with the \(\mathbf{W}^v\) matrices and \(\mathbf{H}\) matrix added.

Arguments

SickleJr

An object of class SickleJr

d

Number of latent factors to use: defaults to 10

random

Boolean indicating whether to use random initialization (TRUE) or NNDSVD (FALSE): default is NNDSVD

numberReps

Number of random initializations to use: default is 5

seed

Random seed for reproducibility of random initializations

minibatch

Indicates whether or not to use the mini-batch algorithm

batchsize

Size of batches for mini-batch NMF

random_W_updates

Indicates whether to only update each \(\mathbf{W}^v\) once per round of \(\mathbf{H}\) updates; only appropriate for mini-batch algorithms

subsample

A vector of values to use for subsampling; only appropriate when determining proper values for d.

usesvd

Indicates whether to use R's singular value decomposition function svd (TRUE) or irlba (FALSE), default is FALSE; use irlba for larger datasets to increase performance

References

Boutsidis2008jrSiCKLSNMF

NMFinRjrSiCKLSNMF

Examples

Run this code
SimSickleJrSmall<-SetLambdasandRowReg(SimSickleJrSmall,
lambdaWlist=list(10,50),lambdaH=500,rowReg="None")
SimSickleJrSmall<-GenerateWmatricesandHmatrix(SimSickleJrSmall,d=5,usesvd=TRUE)

Run the code above in your browser using DataLab