Change of Basis
The same arrow gets different coordinates under different rulers; the change-of-basis matrix translates between the rulers.
Why Does This Exist?
PCA, Fourier features, and every embedding projection change the rulers, not the data. A point cloud stays where it is while you re-express every point in a basis that compresses better or separates classes. If coordinates feel glued to the standard axes, those methods read as magic instead of bookkeeping.
Vectors, matrices, and tensors defines vectors and bases. Linear transformations covers maps that move arrows. This page covers the subtler sibling: the arrow stays fixed while the coordinate system changes.
The one idea you need first
A basis is a set of arrows you measure everything against, and coordinates are the recipe: how much of each basis arrow to add to reach your target. Standard coordinates mean of plus of . Change the basis arrows and the same target needs a different recipe.
Think of It Like This
Describing a walk in two languages
A tourist asks how to reach the fountain. A local says "three blocks east, one north." A sailor says "two leagues along the river heading, one across it." Same fountain, same walk, different reference directions, different numbers. Neither is wrong, and a phrasebook converts between them.
The change-of-basis matrix is that phrasebook. It never moves the fountain; it converts one description into the other. Forgetting which direction you translated is how tourists end up in the harbour, and how ML code mixes up projection directions.
How It Actually Works
Given a new basis with vectors as columns of a matrix , coordinates convert like this:
- New-basis coordinates become standard coordinates via (mix the basis arrows by the recipe).
- Standard coordinates become new-basis coordinates via (unmix).
In plain words: translates new descriptions into standard ones, and its inverse translates back. The arrow never moves; only its description changes.
Worked example
Tilted basis: , . Target arrow: in standard coordinates.
Find the recipe :
Adding: , so . Then . Check: . The same arrow reads on standard rulers and on tilted ones.
Matrix form: , and indeed .
Watch Out For
Translating the phrasebook backwards
and go opposite directions, and swapping them is the most common bug: coordinates that should shrink blow up instead. The symptom is a projection that lands nowhere near the data, often with suspiciously large values. The fix is the round-trip test: convert there and back and confirm you recover the input exactly, , on a hand-checkable vector before trusting the pipeline.
Reading new coordinates as standard ones
After computing , plotting it on standard axes points at the wrong place entirely. The numbers only mean something with their basis attached. The symptom is a visualization where clusters smear or rotate for no reason. Label every coordinate with its basis, the way units label a measurement, and convert back to standard coordinates before plotting on standard axes.
The Quick Version
- A basis is the set of rulers; coordinates are the recipe against those rulers.
- The same arrow has different coordinates in different bases.
- (basis vectors as columns) converts new coordinates to standard: .
- converts standard coordinates to new ones: .
- standard reads in the tilted basis of , .
- Always round-trip a test vector, and never plot coordinates on foreign axes.