Compress, Decompress, Measure the Damage

Dimensionality Reduction & EmbeddingsHard+30 XP+30

Compress, Decompress, Measure the Damage

A service stores each user as a two-number record (x,y)(x, y)(x,y) and wants to compress every record down to a single number using PCA. The pipeline is fitted once, on these five training records:

Userxxxyyy
A222555
B444111
C888888
D101010444
E111111777

Fitting means: centre the training records, build their 2×22 \times 22×2 covariance matrix, and take the unit eigenvector of its largest eigenvalue as the PC1 direction.

A new user record then arrives at (12, 9)(12,\,9)(12,9). It is not used to fit anything — the mean and the covariance matrix stay exactly as the five training records defined them. The new record is pushed through the finished pipeline:

  1. Centre — subtract the training mean.
  2. Compress — project the centred record onto the unit PC1 direction, keeping the single resulting number.
  3. Decompress — multiply that number back by the same unit PC1 direction, then add the training mean back on.

How far is the decompressed point from the original record (12,9)(12, 9)(12,9)?

Give the Euclidean distance, rounded to two decimal places. Carry at least four decimal places through the intermediate steps and round only at the end.

Compressing the Data

Toggle to project every point onto the principal component.

2 numbers per point (x, y)

Instead of storing two coordinates, we now store one position along the line. The important pattern remains.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.

units