Python中怎样实现奇异值SVD分解
1 >>> from numpy import *; 2 >>> U,Sigma,VT=linalg.svd([[1,1],[]7,7]) 3 SyntaxError: invalid syntax 4 >>> U,Sigma,VT=linalg.svd([[1,1],[7,7]]) 5 >>> U 6 array([[-0.14142136, -0.98994949], 7 [-0.98994949, 0.14142136]]) 8 >>> Sigma 9 array([ 10., 0.]) 10 >>> VT 11 array([[-0.70710678, -0.70710678], 12 [-0.70710678, 0.70710678]]) 13 >>>
主要是两条语句:
from numpy import *;
U,Sigma,VT=linalg.svd([[1,1],[7,7]]);