Concepts / Clustering Techniques

Clustering Techniques

The process has two linked transformations: W moves the vector into the smaller space, and U maps that compact representation back into the original space as an approximation.

  • Programming

From Many Coordinates to Fewer

Suppose each data item is represented by a vector with d features. Dimensionality reduction replaces that vector with a representation containing only n coordinates, where n is smaller than d. PCA performs this replacement with a linear transformation and then evaluates the result by asking how closely the original vector can be reconstructed.

xR^d y = W xR^n x̃ = U yR^d WU
How does a vector move from the original high-dimensional space through compression and back to a lower-dimensional approximation?
Key point

The process has two linked transformations: W moves the vector into the smaller space, and U maps that compact representation back into the original space as an approximation.

The Compression Step

Start with one vector x in Rd. The compression matrix W has n rows and d columns, with n smaller than d. Multiplying W by x gives y = W x. Because y belongs to Rn, it contains fewer coordinates than x. This is the central dimensionality-reduction step.

Formula
xd coordinatesWn by dyn coordinatesinputW x
What changes when a vector with d coordinates is mapped into a space with n coordinates, where n is smaller than d?
Wn rows, d columnsxR^d yR^n multipliesinput
How does multiplying a d-dimensional vector by W produce its n-dimensional compressed representation?
Worked example

Tracking the Compressed Representation

A vector x belongs to Rd, and W has n rows and d columns, with n smaller than d. Determine the space containing y = W x.

  1. 1
    Identify the input

    The vector x has d coordinates because it belongs to Rd.

  2. 2
    Inspect the transformation

    The matrix W has n rows and d columns. Its multiplication with x produces one output coordinate for each row of W.

  3. 3
    Identify the result

    The output y = W x therefore belongs to Rn and has fewer coordinates than x.

Result

The compression step maps x from Rd to y in Rn.

Returning to the Original Space

Compression gives the shorter vector y, but PCA also specifies how to return to the original dimensional setting. The recovery matrix U has d rows and n columns. Multiplying U by y produces the recovered vector x̃ = U y. This recovered vector lies in R^d, like the original x, but it is generally an approximation rather than a claim that every detail of x has been restored exactly.

Formula, step by step
  1. 1
    Begin with the compressed representation y in Rn.
  2. 2
    Multiply y by the recovery matrix U.
  3. 3
    Because U has d rows, the result x̃ belongs to Rd.
  4. 4
    Treat x̃ as the recovered approximation of the original vector x.
yR^n Ud rows, n columnsx̃R^d inputU y
How does U transform the compressed vector back into an approximation of the original d-dimensional vector?

Choosing W and U

PCA does not select W and U merely because their dimensions are compatible. For a dataset containing vectors x1 through xm, each vector is first compressed and then recovered. The recovered version of xi is x̃i = U W xi. PCA chooses the pair of matrices so that the total squared distance between the original vectors and their recovered versions is as small as possible.

Formula
Rule

x1 through xmoriginal vectorsW xicompact representationU W xirecovered vectorssquared distancexi versus x̃iminimum totalacross the datasetapply Wapply Ucomparecomparesum
How does PCA choose the compression and recovery transformations to minimize the squared distance between each original vector and its reconstruction?
Worked example

Following One Dataset Vector

Describe the complete transformation applied to one dataset vector xi.

  1. 1
    Compress

    Apply W to xi, producing the compact vector W xi in Rn.

  2. 2
    Recover

    Apply U to the compact vector, producing U W xi in Rd.

  3. 3
    Compare

    Compare the original xi with its recovered version x̃i = U W xi using their squared distance.

  4. 4
    Aggregate

    Repeat this comparison for the dataset vectors x1 through xm and consider the total squared distance.

Result

PCA evaluates the pair W and U by the total squared reconstruction distance across the dataset.

Common Interpretation Errors

  • Common mistake

    Treating dimensionality reduction as an arbitrary change of representation.

    What it looks like

    Describing the shorter vector without identifying the linear transformation W.

    Why it fails

    The source definition specifies a linear mapping from Rd to Rn.

    Do this instead

    State that y = W x and that W maps the original vector into the lower-dimensional space.

  • Common mistake

    Giving the compressed vector the original dimension.

    What it looks like

    Writing that y = W x belongs to R^d.

    Why it fails

    W has n rows, so y belongs to Rn, where n is smaller than d.

    Do this instead

    Track the spaces explicitly: x is in R^d and y is in R^n.

  • Common mistake

    Treating recovery as exact restoration by definition.

    What it looks like

    Claiming that x̃ = U y must equal x.

    Why it fails

    The recovered vector is described as an approximation of the original vector.

    Do this instead

    Write x̃ = U y and describe it as a vector in R^d that is evaluated by its distance from x.

  • Common mistake

    Optimizing compression without considering reconstruction.

    What it looks like

    Saying that PCA chooses W only to make y short.

    Why it fails

    PCA chooses W and U together to minimize total squared distance between original and recovered vectors.

    Do this instead

    Include both transformations and the reconstruction-error objective.

Check Your Understanding

What do you think happens?

If x belongs to Rd and W has n rows and d columns, where does y = W x belong?

  • Rd

  • Rn

  • Rd+n

Reveal answer
Answer:

Rn

The n rows of W produce n output coordinates, so the compressed vector y belongs to Rn.

MEDIUM

A dataset contains vectors x1 through xm in Rd. Explain, in order, how W, U, and the squared distance are used when PCA evaluates one vector xi.

Hints
  • Start with the compression expression W xi.
  • Use U to write the recovered vector.
  • End by describing the comparison between xi and its recovered version.
ObjectRoleSpace or shape
xOriginal vectorRd
WCompression matrixn rows and d columns
y = W xCompact representationRn
URecovery matrixd rows and n columns
x̃ = U yRecovered approximationRd

The roles and dimensions of the main PCA quantities.

Essential Takeaways

  1. 1
    Dimensionality reduction maps vectors linearly from Rd to Rn, with n smaller than d.
  2. 2
    The compression matrix W produces y = W x, the lower-dimensional representation.
  3. 3
    The recovery matrix U produces x̃ = U y, an approximation in the original space Rd.
  4. 4
    For a dataset, PCA evaluates W and U by minimizing the total squared distance between original vectors and their recovered versions.
  5. 5
    The complete reconstruction of xi is x̃i = U W xi.

At a glance

  • Dimensionality reduction uses a linear mapping to replace a vector in Rd with one in the smaller space Rn.
  • W performs compression, while U performs recovery.
  • The recovered vector has d coordinates but is generally an approximation of the original.
  • PCA chooses W and U by minimizing total squared reconstruction distance across the dataset.

Related concepts

More concepts starting with C