Least Squares Is a Projection Problem
Derive a least-squares line fit as an orthogonal projection, verify residuals in NumPy, and see why solving normal equations beats forming an explicit inverse.
Category
14articlesin this category.
Derive a least-squares line fit as an orthogonal projection, verify residuals in NumPy, and see why solving normal equations beats forming an explicit inverse.
Construct a line-projection matrix, apply it to every row of a dataset, and verify the geometry with NumPy checks for symmetry and idempotence.
Compute a projection onto a line, verify its perpendicular residual, and use a transparent NumPy check to approximate an observation inside a model subspace.
Use an integral or a spacing-aware sample sum to compare function shapes, then connect function inner products to basis features in AI.
Describe the directions orthogonal to a subspace, verify a plane normal, and separate an AI representation into explained signal and residual error with NumPy.
Run Gram–Schmidt by hand and in NumPy, read residual size as an overlap diagnostic, and recognize order and floating-point instability.
Verify an orthonormal basis and recover a signal’s coordinates with inner products, then connect the calculation to decorrelated AI features.
Test orthogonality with dot products, interpret a right angle and zero projection, and avoid confusing zero inner product with independence in NumPy.
Compute angles and cosine similarity from vector coordinates, normalize embeddings responsibly, and handle zero vectors in retrieval code.
Derive distance from a norm, compare a tiny nearest-neighbor search under L1, L2, and L-infinity, and debug metric choices in AI systems.
Expand a dot product into feature contributions, build a linear-classifier score, and debug ordering and probability misconceptions with NumPy.
Compute a dot product, read its sign and magnitude geometrically, and see how query-key scores become attention weights.
Compare L1, L2, and L-infinity vector size, see their unit balls change, and distinguish parameter penalties from input-robustness budgets.
Calculate L1, L2, and L-infinity vector norms, verify their defining rules, and see what an embedding magnitude can—and cannot—tell you.