An implementation of the AdaptiveInitialize
algorithm for
matrix imputation for sparse matrices. At the moment the implementation
is only suitable for small matrices with on the order of thousands
of rows and columns at most.
Arguments
- X
A sparse matrix of
sparseMatrix
class. Explicit (observed) zeroes inX
can be dropped for- rank
Desired rank (integer) to use in the low rank approximation. Must be at least
2L
and at most the rank ofX
.- ...
Ignored.
- p_hat
The portion of
X
that is observed. Defaults toNULL
, in which casep_hat
is set to the number of observed elements ofX
. Primarily for internal use incitation_impute()
or advanced users.- alpha_method
Either
"exact"
or"approximate"
, defaulting to"exact"
."exact"
is computationally expensive and requires taking a complete SVD of matrix of sizenrow(X)
xnrow(X)
, and matches theAdaptiveInitialize
algorithm exactly."approximate"
departs from theAdaptiveInitialization
algorithm to compute a truncated SVD of rankrank
+additional
instead of a complete SVD. This reduces computational burden, but the resulting estimates of singular-ish values will not be penalized as much as in theAdaptiveInitialize
algorithm.- additional
Ignored except when
alpha_method = "approximate"
in which case it controls the precise of the approximation toalpha
. The approximate computation ofalpha
will always understandalpha
, but the approximation will be better for larger values ofadditional
. We recommend makingadditional
as large as computationally tolerable.
Value
A low rank matrix factorization represented by an
adaptive_imputation()
object.
Examples
mf <- adaptive_initialize(
ml100k,
rank = 3,
alpha_method = "approximate",
additional = 2
)
mf
#>
#> Adaptively Imputed Low Rank Matrix Factorization
#> ------------------------------------------------
#>
#> Rank: 3
#>
#> Rows: 943
#> Cols: 1682
#>
#> d[rank]: 3359.134
#> alpha: 26.874
#>
#> Components
#>
#> u: 943 x 3 [matrix]
#> d: 3 [numeric]
#> v: 1682 x 3 [matrix]