In [4]:
import numpy as np
from sklearn.decomposition import PCA
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
X=np.array([[-4.8927,-4.9939],
[-7.5595,-5.2557],
[-6.1081,-4.7379],
[-7.6419,-5.7602],
[-6.987,-5.1277],
[-7.3919,-5.5271],
[-7.1961,-5.5584],
[-6.2051,-4.4296],
[-7.0551,-5.3498],
[-6.5356,-5.3201]
])
pca = PCA(n_components=2)
pca.fit(X.T)


Out[4]:
PCA(copy=True, n_components=2, whiten=False)

In [5]:
np.matrix(pca.transform(X.T))*(1)


Out[5]:
matrix([[ -2.64056832e+00,   8.60422844e-16],
        [  2.64056832e+00,   1.24900090e-15]])

In [ ]: