View source: R/S3_decompositions.R
| svd.HDF5Matrix | R Documentation |
Block-wise SVD entirely on disk. The matrix x is decomposed
into x = u %*% diag(d) %*% t(v).
## S3 method for class 'HDF5Matrix'
svd(
x,
nu = min(dim(x)),
nv = min(dim(x)),
center = TRUE,
scale = TRUE,
k = 2L,
q = 1L,
method = "auto",
rankthreshold = 0,
overwrite = FALSE,
threads = -1L,
...
)
x |
An |
nu |
Number of left singular vectors to compute (default = |
nv |
Number of right singular vectors to compute (default = |
center |
Logical. Center columns before decomposition (default |
scale |
Logical. Scale columns before decomposition (default |
k |
Number of local SVDs per incremental level (default 2). |
q |
Number of incremental levels (default 1). |
method |
Computation method: |
rankthreshold |
Numeric in |
overwrite |
Logical. Overwrite existing SVD results (default |
threads |
Integer. OpenMP threads ( |
... |
Ignored (S3 compatibility). |
Singular values d are loaded into a plain numeric vector
(they are always small: at most min(nrow(x), ncol(x)) values).
u and v are returned as HDF5Matrix objects.
Named list with:
dNumeric vector of non-negative singular values, decreasing.
uHDF5Matrix of left singular vectors, nrow(x) x nu.
vHDF5Matrix of right singular vectors, ncol(x) x nv.
tmp <- tempfile(fileext = ".h5")
X <- hdf5_create_matrix(tmp, "data/M", data = matrix(rnorm(500), 50, 10))
res <- svd(X)
length(res$d) # 10 (min(50,10))
dim(res$u) # 50 x 10
dim(res$v) # 10 x 10
X$close()
res$u$close(); res$v$close()
unlink(tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.