| nmfkc.rank | R Documentation |
nmfkc.rank provides diagnostic criteria for selecting the rank (Q)
in NMF with kernel covariates. Three rank-selection measures are computed
(R-squared, the effective rank, and the element-wise CV error), and results
can be visualized in a plot. Sample-clustering quality (silhouette / CPCC /
dist.cor) is no longer part of rank selection; use nmf.cluster.criteria
on a fitted model for those.
By default (save.time = FALSE), this function also computes the
Element-wise Cross-Validation error (Wold's CV Sigma) using nmfkc.ecv.
The plot explicitly marks the "BEST" rank based on two criteria:
Elbow Method (Red): Based on the curvature of the R-squared values (always computed if Q > 2).
Min RMSE (Blue): Based on the minimum Element-wise CV Sigma (only if detail="full").
nmfkc.rank(Y, A = NULL, rank = 1:2, detail = "full", plot = TRUE, data, ...)
Y |
Observation matrix, or a formula (see |
A |
Covariate matrix. If |
rank |
A vector of candidate ranks to be evaluated. |
detail |
|
plot |
Logical. If |
data |
A data frame (required when |
... |
Additional arguments passed to
|
A list containing:
rank.best |
The estimated optimal rank. Prioritizes ECV minimum if available, otherwise R-squared Elbow. |
criteria |
A data frame containing diagnostic metrics for each rank.
The |
Roy, O., & Vetterli, M. (2007). The effective rank: A measure of
effective dimensionality. Proc. 15th European Signal Processing
Conf. (EUSIPCO), 606–610. (effective.rank)
Wold, S. (1978). Cross-validatory estimation of the number of
components in factor and principal components models.
Technometrics, 20(4), 397–405.
\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00401706.1978.10489693")} (sigma.ecv)
nmfkc,
nmfkc.ecv (element-wise CV, used internally),
nmfkc.bicv (block bi-cross-validation),
nmfkc.consensus (stability) and
nmfkc.ard (Bayesian ARD) for alternative rank criteria.
# Example.
Y <- t(iris[,-5])
# Full run (default)
nmfkc.rank(Y, rank=1:4)
# Fast run (skip ECV)
nmfkc.rank(Y, rank=1:4, detail="fast")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.