Create a table summarizing the results of fitting one or more Poisson non-negative matrix factorizations or multinomial topic models.

compare_fits(fits)

Arguments

fits

An object of class "poisson_nmf_fit" or "multinom_topic_model_fit", or a non-empty, named list in which all list elements are Poisson NMF model fits or all multinomial topic model fits.

Value

A data frame with one row per element of fits, and with the following columns:

k

The rank of the matrix factorization.

loglik

The log-likelihood (either Poisson NMF or multinomial topic model likelihood) achieved at the last model fitting update.

dev

For Poisson NMF model fits only, the deviance achieved at the last model fitting update.

res

The maximum residual of the Karush-Kuhn-Tucker (KKT) system achieved at the last model fitting update; small values indicate that the solution is close to a local maximum, or stationary point, of the likelihood.

loglik.diff

The improvement in the log-likelihood relative to the model fit with the smallest log-likelihood.

dev.diff

The improvement in the deviance relative to the model fit with the largest deviance.

nonzeros.f

The rate of nonzeros in the factors matrix, as determined by control$zero.threshold.

nonzeros.l

The rate of nonzeros in the loadings matrix, as determined by control$zero.threshold.

numiter

The number of loadings and/or factor updates performed.

runtime

The total runtime (in s) of the model fitting updates.