Skip to content

Instantly share code, notes, and snippets.

@erogol
Created November 19, 2014 16:28
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 erogol/5db97c119a9a6a9febe8 to your computer and use it in GitHub Desktop.
Save erogol/5db97c119a9a6a9febe8 to your computer and use it in GitHub Desktop.
svd based whitining
def svd_whiten(X):
U, s, Vt = np.linalg.svd(X)
# U and Vt are the singular matrices, and s contains the singular values.
# Since the rows of both U and Vt are orthonormal vectors, then U * Vt
# will be white
X_white = np.dot(U, Vt)
return X_white
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment