| nmf.cluster.criteria | R Documentation |
Computes the clustering-quality criteria silhouette,
CPCC, and dist.cor for a list of models fitted at
different ranks (or a single fit), returning one row per rank. These
are clustering-stability diagnostics (how decisively and
faithfully the samples cluster), conceptually separate from the
rank-selection *.rank functions (which use r.squared, effective
rank, and ECV) and complementary to nmf.cluster.flow
(which shows how the hard clustering itself changes across ranks).
Hard sample clustering requires a non-negative coefficient/score
matrix (so the columns form a membership simplex); when a model's
coefficient is signed (e.g.\ nmfkc.signed, nmfae.signed,
nmfre fits whose coefficient has negative entries) the
hard-label silhouette is NA while the distance-based
CPCC and dist.cor are still computed.
nmf.cluster.criteria(fits, Y, Y2 = NULL, names = NULL, plot = TRUE, ...)
fits |
A list of fitted models, one per rank, all over the same
|
Y |
The original data matrix used to fit the models ( |
Y2 |
Exogenous block, required only for |
names |
Optional character vector (length |
plot |
Logical; draw the diagnostics plot immediately
(default |
... |
When |
An object of class "nmf.cluster.criteria" (returned
invisibly): a list with criteria (a data frame with one row
per result and columns rank, silhouette, CPCC,
dist.cor, and hard) and labels (the x-axis
labels). Results are kept in the given order (not sorted).
nmf.cluster.flow, nmfkc.rank
Y <- t(as.matrix(iris[, 1:4]))
fits <- lapply(2:6, function(q) nmfkc(Y, Q = q, print.dims = FALSE))
cc <- nmf.cluster.criteria(fits, Y, plot = FALSE)
cc$criteria
plot(cc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.