A pseudo-inverse generalizes matrix inversion to nonsquare linear systems. It produces a solution that minimizes the error when an exact solution is unavailable, making it useful for overdetermined machine-learning models. section 2.12.4 section 2.12
For an overdetermined system A x ≈ b, transpose the system and solve the square normal equations. Assuming AᵀA is invertible, the resulting expression is A⁺ = (AᵀA)⁻¹Aᵀ. Unlike an ordinary inverse, this construction applies when A is not square. section 2.12.4
Geometrically, A x is the point in A’s column space closest to b. The residual b − A x is perpendicular to that column space, so the pseudo-inverse selects the least-squares projection. section 2.12.5
The pseudo-inverse connects linear algebra to model fitting in two complementary ways:
- Use augmented inputs to place model features and a bias term in one matrix X, then solve for weights with X⁺. section 2.12.5
- Use singular value decomposition to solve arbitrary systems without directly inverting A; for square invertible matrices, this agrees with the ordinary inverse solution. section 4.5.4
Fitting a toy threat-score model
Training examples pair hardness and sharpness with threat scores. After augmenting each input with 1 for the bias, the resulting overdetermined system estimates weights w₀, w₁, and b by minimizing the total prediction error. section 2.12.5 section 2.12
Figure 2.12 Solving a linear system A
=
is equivalent to finding the point on the column space of A that is closest to
. This means we have to drop a perpendicular from
to column space of A. If A
represents the point where that perpendicular meets the column space (aka projection), the difference vector
− A
corresponds to the line joining
and its projection A
. This line will be perpendicular to all vectors in the column space of A. Equivalently, it is perpendicular to A
for any arbitrary
.
Inspect the geometric construction: projecting b onto the column space of A makes the residual perpendicular to every column-space direction. section 2.12.5

