eimpute | R Documentation |
Fit a low-rank matrix approximation to a matrix with missing values. The algorithm iterates like EM: filling the missing values with the current guess, and then approximating the complete matrix via truncated SVD.
eimpute( x, r, svd.method = c("tsvd", "rsvd"), noise.var = 0, thresh = 1e-05, maxit = 100, init = FALSE, init.mat = 0, override = FALSE, control = list(...), ... )
x |
an m by n matrix with |
r |
the rank of low-rank matrix for approximating |
svd.method |
a character string indicating the truncated SVD method.
If |
noise.var |
the variance of noise. |
thresh |
convergence threshold, measured as the relative change in the Frobenius norm between two successive estimates. |
maxit |
maximal number of iterations. |
init |
if init = FALSE(the default), the missing entries will initialize with mean. |
init.mat |
the initialization matrix. |
override |
logical value indicating whether the observed elements in |
control |
a list of parameters that control details of standard procedure, See biscale.control. |
... |
arguments to be used to form the default control argument if it is not supplied directly. |
A list containing the following components
|
the matrix after completion. |
|
the relative mean square error of matrix completion, i.e., training error. |
|
the number of iterations. |
Rahul Mazumder, Trevor Hastie and Rob Tibshirani (2010) Spectral Regularization Algorithms for Learning Large Incomplete Matrices, Journal of Machine Learning Research 11, 2287-2322
Nathan Halko, Per-Gunnar Martinsson, Joel A. Tropp (2011) Finding Structure with Randomness: Probabilistic Algorithms for Constructing Approximate Matrix Decompositions, Siam Review Vol. 53, num. 2, pp. 217-288
################# Quick Start ################# m <- 100 n <- 100 r <- 10 x_na <- incomplete.generator(m, n, r) head(x_na[, 1:6]) x_impute <- eimpute(x_na, r) head(x_impute[["x.imp"]][, 1:6]) x_impute[["rmse"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.