k_fold-methods | R Documentation |
k-mode folding of a matrix into a Tensor. This is the inverse funtion
to k_unfold
in the m mode. In particular,
k_fold(k_unfold(darr, m), m, dim(darr))
will result in the original Tensor.
k_fold(mat, m = NULL, modes = NULL)
## S4 method for signature 'DelayedArray'
k_fold(mat, m, modes)
mat |
DelayedArray object (only 2D) |
m |
the index of the mode that is mapped onto the row indices |
modes |
the modes of the output DelayedArray |
This function is an extension of the k_fold
by DelayedArray.
This is a wrapper function to fold
.
DelayedArray object with modes given by modes
T. Kolda, B. Bader, "Tensor decomposition and applications". SIAM Applied Mathematics and Applications 2009.
fold
, k_unfold
library("DelayedRandomArray")
darr <- RandomUnifArray(c(2,3,4))
matT2 <- k_unfold(darr, m=2)
identical(
as.array(k_fold(matT2, m=2, modes=c(2,3,4))),
as.array(darr))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.