Skip to contents

Assigns user-specified names to the decoder (X1 columns) and encoder (X2 rows) bases of an nmfae object. The names propagate to \(\Theta\), the coefficients table, and all downstream displays such as summary, nmfae.DOT, and nmfae.heatmap.

Usage

nmfae.rename(x, X1.colnames = NULL, X2.rownames = NULL)

Arguments

x

An object of class "nmfae" returned by nmfae.

X1.colnames

Character vector of length \(Q\) for decoder bases (columns of \(X_1\) / rows of \(\Theta\)). If NULL (default), the decoder names are left unchanged.

X2.rownames

Character vector of length \(R\) for encoder bases (rows of \(X_2\) / columns of \(\Theta\)). If NULL (default), the encoder names are left unchanged.

Value

A modified copy of x with updated names.

See also

Examples

# \donttest{
set.seed(1)
Y <- matrix(runif(15), nrow = 3)
res <- nmfae(Y, rank = 2, rank.encoder = 2)
res <- nmfae.rename(res,
  X1.colnames = c("Basis1", "Basis2"),
  X2.rownames = c("Enc1", "Enc2"))
summary(res)
#> 
#> Call:
#> nmfae(Y1 = Y, rank = 2, rank.encoder = 2)
#> 
#> Dimensions:
#>   Y1:              3 x 5 
#>   Y2:              3 x 5   (autoencoder) 
#>   Decoder rank Q:  2 
#>   Encoder rank R:  2 
#>   Parameters:      X1(3x2) + C(2x2) + X2(2x3) = 16 
#> 
#> Convergence:
#>   Iterations:      229 
#>   Runtime:         0.0 secs 
#> 
#> Goodness of fit:
#>   Objective function:   0.1071 
#>   Multiple R-squared:   0.9131 
#>   Residual Std Error:   0.08448 
#>   Mean Absolute Error:  0.05914 
#> 
#> Structure Diagnostics:
#>   X1 sparsity (< 1e-4):     16.7% 
#>   C sparsity (< 1e-4):      0.0% 
#>   X2 sparsity (< 1e-4):     0.0% 
#> 
# }