Description Usage Arguments Note Examples
use sklearn.incrementalPCA interfaced to package-local python module
1 2 3 4 5 | biocIPCA(mat, n_comp, batch_size)
biocPCA(mat, n_comp)
biocIPCA_chunked(mat, chunk_size, n_comp, batch_size)
|
n_comp |
number of PCs to compute |
batch_size |
number of records handled in each batch |
R |
matrix |
biocIPCA_chunked uses partial_fit over all chunks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # small example
dd = data.matrix(iris[,1:4])
Rpcs = prcomp(dd)
Ppcs = biocIPCA(dd, 4, 10)
cor(Rpcs$x, Ppcs$rotated)
# bigger
data(bano5k)
bpc = prcomp(bano5k)
Pbpc = biocIPCA(bano5k, 5, 1000) # need mem profiling
cor(bpc$x[,1:5], Pbpc$rotated)
Pbpc[[1]]$explained_variance_
Pbpc2 = biocIPCA(bano5k, 5, 5000) # may have higher mem cost
cor(bpc$x[,1:5], Pbpc2$rotated) # better
Pbpc2[[1]]$explained_variance_
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.