rand.init: Random initialization of factor models

Description Usage Arguments Details Value See Also

View source: R/rand.init.R

Description

Initialize factor models "W" and "H" by sampling values from A, simulating comparable random distributions, or specifying uniform distribution bounds

Usage

1
2
3
4
5
6
7
8
9
rand.init(
  A,
  k,
  W.method = "sample",
  H.method = "sample",
  n.sd = 1,
  bounds = c(1e-05, 1),
  seed = NULL
)

Arguments

A

input dgCMatrix

k

rank

W.method

One of c("sample", "random", "bounded")

H.method

One of c("sample", "random", "bounded")

n.sd

number of standard deviations from the mean over which to sample values in A (excluding zeros). Applies only to method = c("sample", "random")

bounds

sample values between bounds if method = "bounded"

seed

never ever not remember to set the seed. It's NULL by default

Details

Methods support positive, non-zero initializations only.

Values in W and H will automatically be scaled to approximate the distribution of A upon multiplication. Possible scenarios:

Basic usage:

If these initialization methods do not satisfy, LSMF also takes matrices as initializations for "W" and "H".

Value

list of matrices "W" and "H"

See Also

nndsvd, lsmf


zdebruine/LSMF documentation built on Jan. 1, 2021, 1:50 p.m.