Skip to content

Instantly share code, notes, and snippets.

@andykitchen
Created October 19, 2015 12:15
Show Gist options
  • Select an option

  • Save andykitchen/eb00f6dc39e34e211eeb to your computer and use it in GitHub Desktop.

Select an option

Save andykitchen/eb00f6dc39e34e211eeb to your computer and use it in GitHub Desktop.
U,s,V = np.linalg.svd(X, full_matrices=False)
n = X.shape[0]
k = n # or however many terms you want to keep
X_zca = np.sqrt(n) * U[:,:k].dot(V[:k])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment