Skip to contents

Element-wise k-fold cross-validation for nmfae.signed to select the decoder / encoder ranks \((Q, R)\). Mirrors nmfae.ecv but uses the weighted Signed-Bottleneck NMF-AE fit path (Y1.weights): test-fold elements are zero-weighted during fitting, and held-out MSE is computed on those elements.

Usage

nmfae.signed.ecv(Y1, Y2 = Y1, rank = 1:2, rank.encoder = NULL, ...)

Arguments

Y1

Output matrix (P1 x N).

Y2

Input matrix (P2 x N). Default Y1.

rank

Integer vector of candidate Q values. Default 1:2.

rank.encoder

Integer vector of candidate R values, or NULL (default: pair R = Q, diagonal grid).

...

Additional arguments:

nfolds / div

Number of folds. Default 5.

seed

RNG seed for fold assignment. Default 123.

nstart

Number of random restarts per fit. Default 1. Signed models have more local minima (the bottleneck can carry both signs), so nstart >= 10 is recommended for reproducible rank selection.

Other args

epsilon, maxit, warm.start, etc.\ are passed to nmfae.signed.

Value

An object of class c("nmfae.signed.ecv", "nmfae.ecv") with objfunc (MSE per pair), sigma (RMSE), objfunc.fold (per-fold MSE), folds, QR, paired.

Lifecycle

This function is experimental. The interface may change in future versions.

References

Ding, C. H. Q., Li, T., & Jordan, M. I. (2010). Convex and semi-nonnegative matrix factorizations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(1), 45–55.