| nmf.rrr.ecv | R Documentation |
nmfae.ecv performs k-fold element-wise cross-validation by randomly
holding out individual elements of Y_1, assigning them a weight of 0
via Y1.weights, and evaluating the reconstruction error on those
held-out elements.
This method (also known as Wold's CV) is suitable for determining the optimal
rank pair (Q, R) in three-layer NMF. Both rank1 and rank2 accept
vector inputs. When rank2 = NULL (default), rank2 is set equal to rank1
and pairs are evaluated element-wise (i.e., (Q_1, R_1), (Q_2, R_2), \dots).
When rank.encoder is explicitly specified, all combinations of rank and rank.encoder
are evaluated via expand.grid.
nmf.rrr.ecv(
Y1,
Y2 = Y1,
rank1 = 1:2,
rank2 = NULL,
...,
rank = NULL,
rank.encoder = NULL
)
Y1 |
Output matrix |
Y2 |
Input matrix |
rank1 |
Integer vector of response-basis ranks to evaluate. Default is |
rank2 |
Integer vector of covariate-basis ranks to evaluate. Default is |
... |
Additional arguments passed to |
rank, rank.encoder |
Deprecated aliases of |
A list with components:
objfunc |
Named numeric vector of mean MSE for each (Q, R) pair. |
sigma |
Named numeric vector of RMSE (square root of MSE) for each pair. |
objfunc.fold |
Named list of per-fold MSE vectors for each pair. |
folds |
List of length |
QR |
Data frame with columns |
This function is experimental. The interface may change in future versions; details are to be described in an upcoming paper.
nmfae, nmfkc.ecv
Y <- t(iris[1:30, 1:4])
# Default: rank2=NULL -> paired rank1=rank2
res <- nmf.rrr.ecv(Y, rank1 = 1:3, nfolds = 3, maxit = 500)
res$sigma
# Explicit rank.encoder: full grid
res2 <- nmf.rrr.ecv(Y, rank1 = 1:3, rank2 = 1:3, nfolds = 3, maxit = 500)
res2$sigma
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.