python - Principal Component Analysis with numpy and matplotlib -


i have array, representing kind of tables:

grid type

and trying result through pca, elements(e1,e2,e3) similar each other, concerns(c1,c2,c3) similar each other. achieve i'm using matplotlib , numpy:

var_grid = np.array(matrixalternatives) #create pca node , train pcan = mdp.nodes.pcanode(output_dim=2, svd=true) pcar = pcan.execute(var_grid)  fig = plt.figure() ax = fig.add_subplot(111) ax.plot(pcar[:, 0], pcar[:, 1], 'bo') ax.plot(pcan.v[:,0], pcan.v[:,1], 'ro') #eigenvectors: pcan.v 

however got result this: myresult

as can see, concerns near each other, makes impossible analyse.

the matrixes:

pcar [[-54.84 -14.21],  [-10.35  22.58],  [ 65.19  -8.37]]  eigenvectors: [[-0.05  0.96],  [-0.54 -0.25],  [ 0.84 -0.11]] 

when same analysis idiogrid tool, result better:

idio

elemnts in same position pca(just mirrored), concerns different. values:

con_1 0.19 0.98, con_2 0.98 -0.19, con_3 -1.00 0.00

ele_1 0.87 -0.53, ele_2 0.22 0.80, ele_3 -1.09 -0.27

what think i'm doing wrong?


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -