plot.nmfre: Plot convergence diagnostics for NMF models

View source: R/s3methods.R

plot.nmfreR Documentation

Plot convergence diagnostics for NMF models

Description

Plots the objective function value over iterations for nmfre and nmf.sem objects. (For nmfkc and nmfae, plot methods are defined in their respective source files.)

Usage

## S3 method for class 'nmfre'
plot(x, ...)

## S3 method for class 'nmf.sem'
plot(x, ..., which = c("full", "reconstruction", "both"))

Arguments

x

A fitted model object.

...

Additional graphical arguments passed to plot.

which

For plot.nmf.sem: which objective to plot. One of "full" (default; loss + penalties, the actual monotonically-decreasing quantity that the multiplicative updates minimize), "reconstruction" (Frobenius distance only, \| Y_1 - X B \|_F^2), or "both" (overlay both with a legend). "both" is useful for diagnosing whether regularization is actively shaping the solution: if the two curves diverge, the penalties are pulling the optimizer away from the pure least-squares minimum.

Value

Invisible NULL.

See Also

nmfre, nmf.sem

Examples


set.seed(1)
Y <- matrix(runif(20), nrow = 4)
A <- diag(5)
res <- nmfre(Y, A, rank = 2)
plot(res)



nmfkc documentation built on July 14, 2026, 1:07 a.m.