Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- m = np.matrix ([[ 1., 2., 3., 4., 0.],
- [ 3., 4., 5., 6., 0.],
- [ 0., 3., 2., 1., 1.]])
- U, s, VT = np.linalg.svd(m, full_matrices=False)
- X_a = np.dot(np.dot(U, np.diag(s)), VT)
- #print(np.std(m), np.std(X_a), np.std(m - X_a))
- print(U)
- print("*")
- print(s)
- print("*")
- print(VT);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement