Learn Before
Concept

Decompositions

•EIGENVALUES AND EIGENVECTORS

la, v = linalg.eig(A) #Solve ordinary or generalized eigenvalue problem for square matrix l1, l2 = la #Unpack eigenvalues v[:,0] #First eigenvector v[:,1] #Second eigenvector linalg.eigvals(A) #Unpack eigenvalues

•SINGULAR VALUE DECOMPOSITION

U,s,Vh = linalg.svd(B) #Singular Value Decomposition (SVD) M,N = B.shape Sig = linalg.diagsvd(s,M,N) #Construct sigma matrix in SVD

•LU DECOMPOSITION

P,L,U = linalg.lu(C) #LU Decomposition

0

1

Updated 2021-06-21

Tags

Python Programming Language

Data Science