Description Usage Arguments Value Examples
View source: R/truncated-svd.R
Compress a matrix using the truncated SVD. Exactly one of rank, ratio and avg.error should be specified. The compression ratio will be at least the given value, or the average error will be at most the given value. The average error is the Frobenius norm of the error divided by the square root of the number of elements in the matrix.
1 | compress.matrix(mtx, rank = NA, ratio = NA, avg.error = NA)
|
mtx |
matrix |
rank |
rank of the truncated SVD |
ratio |
compression ratio |
avg.error |
average error |
compressed.matrix object with decomposition, rank, error, avg.error
1 2 3 | compress.matrix(matrix(1:12, 4, 3), rank=2)
compress.matrix(matrix(1:12, 4, 3), ratio=1.1)
compress.matrix(matrix(1:12, 4, 3), avg.error=0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.