citation_impute {fastadi} | R Documentation |
CitationImpute
Description
An implementation of the AdaptiveImpute
algorithm using efficient
sparse matrix computations, specialized for the case when missing
values in the upper triangle are taken to be explicitly observed
zeros, as opposed to missing values. This is primarily
useful for spectral decompositions of adjacency matrices of graphs
with (near) tree structure, such as citation networks.
Usage
citation_impute(
X,
rank,
...,
initialization = c("svd", "adaptive-initialize", "approximate"),
max_iter = 200L,
check_interval = 1L,
epsilon = 1e-07,
additional = NULL
)
## S3 method for class 'sparseMatrix'
citation_impute(
X,
rank,
...,
initialization = c("svd", "adaptive-initialize", "approximate"),
additional = NULL
)
## S3 method for class 'LRMF'
citation_impute(
X,
rank,
...,
epsilon = 1e-07,
max_iter = 200L,
check_interval = 1L
)
Arguments
X |
A square sparse matrix of |
rank |
Desired rank (integer) to use in the low rank approximation.
Must be at least |
... |
Unused additional arguments. |
initialization |
How to initialize the low rank approximation. Options are:
Note that initialization matters as |
max_iter |
Maximum number of iterations to perform (integer). Defaults
to |
check_interval |
Integer specifying how often to perform convergence
checks. Defaults to |
epsilon |
Convergence criteria, measured in terms of relative change
in Frobenius norm of the full imputed matrix. Defaults to |
additional |
Ignored except when |
Details
If OpenMP is available, citation_impute
will automatically
use getOption("Ncpus", 1L)
OpenMP threads to parallelize some
key computations. Note that some computations are performed with
the Armadillo C++ linear algebra library and may also be parallelized
dependent on your BLAS and LAPACK installations and configurations.
Value
A low rank matrix factorization represented by an
adaptive_imputation()
object.
Examples
# create a (binary) square sparse matrix to demonstrate on
set.seed(887)
n <- 10
A <- rsparsematrix(n, n, 0.1, rand.x = NULL)
mf <- citation_impute(A, rank = 3L, max_iter = 1L, check_interval = NULL)
mf