gg_plotKStats: Plots optimal K metrics

View source: R/plot_functions_lite.R

gg_plotKStatsR Documentation

Plots optimal K metrics

Description

For every factorization rank the Frobenius error, coefficient variation of Frobenius error, sum Silhouette Width, mean Silhouette width, cophenetic coefficient and mean Amari distance is shown.

Usage

gg_plotKStats(
  nmf_exp,
  plot_vars = c("FrobError", "FrobError_cv", "sumSilWidth", "meanSilWidth",
    "copheneticCoeff", "meanAmariDist")
)

Arguments

nmf_exp

an object of class ButchR_NMF, ButchR_joinNMF, or ButchR_integrativeNMF.

plot_vars

a character vector with the ids of the metrics to display. possible values are: FrobError, FrobError_min, FrobError_mean, FrobError_cv, FrobError_sd, sumSilWidth, meanSilWidth, copheneticCoeff, and meanAmariDist. Default value: c("FrobError", "FrobError_cv", "sumSilWidth", "meanSilWidth", "copheneticCoeff", "meanAmariDist").

Value

a ggplot figure with the values for the selected factorization metrics

Examples

## Not run: 
data("leukemia")
nmf_exp <- run_NMF_tensor(leukemia$matrix, ranks = 2:10,
method = "NMF",
n_initializations = 2)
gg_plotKStats(nmf_exp)

## End(Not run)

hdsu-bioquant/ButchR documentation built on Jan. 28, 2023, 6:06 p.m.