from jhplot import *
from jhplot.math.pca import *
from Jama import Matrix
train=Matrix([[1, 2, 3, 4, 5, 6],
[6, 5, 4, 3, 2, 1],
[2, 2, 2, 2, 2, 2]])
pca=PCA(train)
test=Matrix( [[1, 2, 3, 4, 5, 6],
[1, 2, 1, 2, 1, 2] ])
TYPE=PCA.TransformationType.WHITENING
tr=pca.transform(test, TYPE)
print "WHITENING=",tr
TYPE=PCA.TransformationType.ROTATION
tr=pca.transform(test, TYPE)
print "ROTATION=",tr
Ads help maintain this website.