Same as the evaluate S4 method for the nmf class, but allows one to input the `w`, `d`, `h`, and `data` independently.
Arguments
- w
feature factor matrix (features as rows)
- d
scaling diagonal vector (if applicable)
- h
sample factor matrix (samples as columns)
- data
dense or sparse matrix of features in rows and samples in columns. Prefer
matrixorMatrix::dgCMatrix, respectively. Also accepts a file path (character string) which will be auto-loaded based on extension.- mask
missing data mask. Accepts:
NULL(no masking),"zeros"(mask zeros),"NA"(mask NAs), a dgCMatrix/matrix (custom mask), orlist("zeros", <matrix>)to mask zeros and use a custom mask simultaneously.- missing_only
only calculate mean squared error at masked values
- ...
additional arguments
Examples
if (FALSE) { # \dontrun{
data <- simulateNMF(50, 30, k = 3, seed = 1)
model <- nmf(data$A, 3, seed = 1, maxit = 50)
RcppML:::mse(model$w, model$d, model$h, data$A)
} # }