View source: R/initializeCMTF.R
initializeCMTF | R Documentation |
Initialize input vectors for the CMTF algorithm
initializeCMTF(
Z,
numComponents,
initialization = "random",
output = "Fac",
Y = NULL
)
Z |
List object as generated by |
numComponents |
Integer stating the number of desired components for the CMTF model. |
initialization |
Initialization method, either "random" or "nvec" (default "random"). Random will initialize random input vectors. Nvec will initialize vectors according to an singular value decomposition of the (matricized, if needed) concatenated datasets per mode. |
output |
How to return output: as a "Fac" object (default) or vectorized ("vect"). |
Y |
Used as dependent variable when initialization is set to "npls". Not used by default. |
List or vector of initialized input vectors per mode.
set.seed(123)
A = array(rnorm(108*2), c(108, 2))
B = array(rnorm(100*2), c(100, 2))
C = array(rnorm(10*2), c(10, 2))
D = array(rnorm(100*2), c(100,2))
E = array(rnorm(10*2), c(10,2))
df1 = reinflateTensor(A, B, C)
df2 = reinflateTensor(A, D, E)
datasets = list(df1, df2)
modes = list(c(1,2,3), c(1,4,5))
Z = setupCMTFdata(datasets, modes, normalize=FALSE)
init = initializeCMTF(Z, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.