Matrix inverse
Say it: "A inverse"
What it means
The matrix that undoes : (the identity). Only square matrices with a non-zero determinant have one.
Example
Undoing a stretch is shrinking back.
In code
import numpy as np A = np.array([[2.0, 0], [0, 4.0]]) print(np.linalg.inv(A)) print(np.linalg.inv(A) @ A)
Output
[[0.5 0. ] [0. 0.25]] [[1. 0.] [0. 1.]]
Where it appears in machine learning
The formula for linear regression, . In code, solve systems with np.linalg.solve rather than inverting.
Related symbols
Learn it properly in the free lesson Matrices, with practice questions that check your answers.