Eigenvalues, eigenvectors, solving systems of linear equations, and SVD.
Advanced linear algebra powers modern Machine Learning algorithms like PCA and PageRank. `np.linalg.eig` computes eigenvalues, and `np.linalg.solve` solves $Ax = b$.
Eigenvectors are the special axis directions where a matrix transformation only stretches or shrinks vectors without rotating them.
`np.linalg.solve(A, b)` solves linear systems much faster and with greater numerical stability than computing `inv(A) @ b`.
x = np.linalg.solve(A, b)x = np.linalg.inv(A) @ b # Numerically unstable & slowerx = np.linalg.solve(A, b) # Stable LU decompositionMatrix inversion introduces floating-point errors. `solve` uses stable LU/Cholesky decomposition.
Solve the objective below using NumPy vectorized syntax
Solve `A = np.array([[1, 1], [1, 2]])` and `b = np.array([5, 7])` using `np.linalg.solve(A, b)` and print.
[3. 2.]