Learn R Programming

reco (version 0.2.0.4)

soft_impute: SoftImpute/SoftSVD matrix factorization

Description

Fit SoftImpute/SoftSVD via fast alternating least squares. Based on the paper by Trevor Hastie, Rahul Mazumder, Jason D. Lee, Reza Zadeh by "Matrix Completion and Low-Rank SVD via Fast Alternating Least Squares" - https://arxiv.org/pdf/1410.2596.pdf

Usage

soft_impute(x, rank = 10L, lambda = 0, n_iter = 100L,
  convergence_tol = 0.001, init = NULL, final_svd = TRUE)

soft_svd(x, rank = 10L, lambda = 0, n_iter = 100L, convergence_tol = 0.001, init = NULL, final_svd = TRUE)

Arguments

x

sparse matrix. Both CSR dgRMatrix and CSC dgCMatrix are supported. in case of CSR matrix we suggest to load https://github.com/dselivanov/MatrixCSR package which provides multithreaded CSR*dense matrix products (if OpenMP is supported on your platform). On many-cores machines this reduces fitting time significantly.

rank

maximum rank of the low-rank solution.

lambda

regularization parameter for nuclear norm

n_iter

maximum number of iterations of the algorithms

convergence_tol

convergence tolerance. Internally we keep track relative change of frobenious norm of two consequent iterations.

init

svd like object with u, v, d components to initialize algorithm. Algorithm benefit from warm starts. init could be rank up rank of the maximum allowed rank. If init has rank less than max rank it will be padded automatically.

final_svd

logical whether need to make final preprocessing with SVD. This is not necessary but cleans up rank nicely - hithly recommnded to leave it TRUE.

Value

svd-like object - list with u, v, d components - left, right singular vectors and singular vectors.