Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lettergram/b8e430dea7a63cae1ae2 to your computer and use it in GitHub Desktop.
Save lettergram/b8e430dea7a63cae1ae2 to your computer and use it in GitHub Desktop.
PCA in python
import numpy as np
matrix = np.matrix(matrix) * np.matrix(matrix).transpose()
U,S,V = np.linalg.svd(matrix)
T = U * S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment