Home > Back-end >  How to Plot in 3D Principal Component Analysis Visualizations, using the fast PCA script from this a
How to Plot in 3D Principal Component Analysis Visualizations, using the fast PCA script from this a

Time:10-26

I found enter image description here

CodePudding user response:

  • trans = pca(data, 3)[0] is the U data, since [0] selects the first index of the returned data, and pca returns U, E, V
  • ax2.scatter(trans[:50, 0], trans[:50, 1], c = 'r') plots the first 50 rows of column 0 against the first 50 rows of column 1, and ax2.scatter(trans[50:, 0], trans[50:, 1], c = 'b') does the same for rows from 50 to the end. This from the sample data given in enter image description here

  • Related