biocIPCA: use sklearn.incrementalPCA interfaced to package-local python...

Description Usage Arguments Note Examples

Description

use sklearn.incrementalPCA interfaced to package-local python module

Usage

1
2
3
4
5
biocIPCA(mat, n_comp, batch_size)

biocPCA(mat, n_comp)

biocIPCA_chunked(mat, chunk_size, n_comp, batch_size)

Arguments

n_comp

number of PCs to compute

batch_size

number of records handled in each batch

R

matrix

Note

biocIPCA_chunked uses partial_fit over all chunks.

Examples

 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_

vjcitn/useret documentation built on May 8, 2019, 11:19 p.m.