Created
November 19, 2014 16:28
-
-
Save erogol/5db97c119a9a6a9febe8 to your computer and use it in GitHub Desktop.
svd based whitining
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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