Concepts / Random Projection

Random Projection

The lemma gives a probabilistic guarantee that distances between vectors can be preserved after projection into a lower-dimensional space.

  • Programming

Why Reduce Dimensions

Many datasets represent each item as a vector with a large number of dimensions. Working with fewer dimensions can make the representation smaller, but the reduction is useful only if it preserves important structure. For the Johnson-Lindenstrauss Lemma, the important structure is the set of distances between vectors in a finite collection.

Random projection addresses this challenge with a random linear transformation. A vector begins in a high-dimensional space, and a random matrix maps it into a lower-dimensional space. The Johnson-Lindenstrauss Lemma gives a probabilistic guarantee that the distances between vectors in a finite set can remain within a controlled distortion factor after this mapping.

The Matrix Mapping

Let a vector have d coordinates. The random projection uses a matrix W in R^(n,d), where d describes the original dimension and n describes the target dimension. The target dimension is lower when n is smaller than d. Applying W to the vector creates its projected representation in the lower-dimensional space.

inputprojectionVector xd coordinatesRandom matrix Wn by dProjected vectorn coordinates
How does a random matrix transform a vector from d coordinates into n coordinates, where n is smaller than d?

Reading the dimensions

Suppose a vector is represented with d coordinates and W is in R^(n,d), with n smaller than d. What does the projection do?

Start with the vector: The vector belongs to the original d-dimensional representation.

Apply W: The random matrix transforms the vector using its n by d structure.

Read the result: The projected representation has n coordinates, so it uses fewer dimensions than the original vector.

The matrix W maps a d-dimensional vector into an n-dimensional representation.

What the Lemma Guarantees

The Johnson-Lindenstrauss Lemma states that a finite set of vectors can be projected into a lower-dimensional space so that pairwise Euclidean distances are preserved within a factor of 1 ± ε with high probability, under the lemma's condition on the target dimension.

The finite-set requirement matters. The guarantee concerns the distances between the vectors in a finite set Q in R^d. It does not say that every possible vector in the original space has all of its relationships preserved exactly. Instead, it gives a probabilistic statement about the selected finite collection.

  • Q is the finite vector set whose pairwise distances matter.
  • d is the original dimension of the vectors.
  • n is the lower target dimension after projection.
  • δ is the probability parameter in the lemma's setup.
  • W is the random matrix used to perform the projection.
  • ε describes the allowed distance distortion through the factor 1 ± ε.
containsrandom projectioncomparecontrolled distortionFinite set Qoriginal spaceProjected setlower-dimensional spacePairwise distancesin QPairwise distanceswithin factor 1 ± ε
What changes when a finite set of points is projected into a lower-dimensional space, and how are pairwise Euclidean distances compared?

Interpreting Probability

The word probabilistic is central. The matrix is selected randomly, so the lemma does not promise that every random choice will preserve all pairwise distances within the desired factor. Instead, it gives a high-probability guarantee for the finite set under the lemma's condition.

The parameter δ belongs to the probability part of the setup. It represents the probability allowance associated with failure of the distance-preservation guarantee. Thus, the result should be read as a statement about how likely the desired distortion bound is to hold for the random projection, not as a statement of exact certainty.

InterpretationWhat the lemma saysWhat it does not say
DistancePairwise Euclidean distances can stay within a factor of 1 ± ε.Every distance remains exactly unchanged.
ProbabilityThe bound holds with high probability for the finite set.Every random matrix necessarily succeeds.
DimensionThe representation can use a lower target dimension n.All information of every possible vector is retained without change.

What do you think happens?

A random projection changes the coordinates of vectors and uses fewer dimensions. What does the Johnson-Lindenstrauss guarantee focus on preserving?

  • The exact value of every original coordinate
  • Pairwise Euclidean distances in a finite vector set
  • The original number of dimensions
  • The identity of the random matrix entries
Reveal answer

Answer: Pairwise Euclidean distances in a finite vector set

The lemma concerns the distances between vectors in a finite set. It allows controlled distortion rather than requiring the original coordinates or distances to remain exactly the same.

Random Projection and Sparsity

Random projection and compressed sensing share a broad goal: replace a high-dimensional vector with a lower-dimensional description while retaining useful structure. Their assumptions are different. Random projection uses a random linear transformation and focuses on limiting distance distortion for a finite set. Compressed sensing uses prior knowledge that a vector is sparse in some basis.

In the compressed-sensing setting described by the source, a vector x in R^d is sparse when it has at most s nonzero elements in some basis. Most entries are zero, or only a small number of basis coefficients are nonzero.

supportsassumessupportsshared dimensionality-reduction goalRandom projectionrandom lineartransformationCompressed sensinguses prior structureLimited distancedistortionfinite vector setSparse in a basisat most s nonzero elementsLower-dimensionaldescriptionshared goal
How do random projection and compressed sensing share a dimensionality-reduction goal while relying on different assumptions?

Choosing the right assumption

Two methods both replace high-dimensional vectors with shorter descriptions. One method selects a random matrix and evaluates whether distances in a finite set are controlled. The other relies on a vector having at most s nonzero coefficients in some basis. Which method matches each description?

Identify the transformation: A random matrix and a distance guarantee identify random projection.

Identify the prior knowledge: Knowing that only a small number of basis coefficients are nonzero identifies the sparsity assumption used by compressed sensing.

Compare the goals: Both seek a lower-dimensional description, but they preserve or exploit different kinds of structure.

Random projection relies on a random linear transformation and controlled distance distortion; compressed sensing relies on sparsity in a basis.

Mistakes to Avoid

  • Treating random projection as exact distance preservation.

    The lemma guarantees controlled distortion within a factor of 1 ± ε with high probability, not exact equality.

    Fix: Describe the result as limiting Euclidean distance distortion for the finite vector set.

  • Ignoring the finite-set condition.

    The setup concerns a finite vector set Q in R^d.

    Fix: State which finite collection of vectors and pairwise distances the guarantee concerns.

  • Confusing the original and target dimensions.

    In W in R^(n,d), d represents the original dimension and n represents the target dimension.

    Fix: Remember that the projection maps from d coordinates into n coordinates.

  • Confusing random projection with compressed sensing.

    Sparsity in a basis is the prior assumption described for compressed sensing, while random projection uses a random matrix and a distance-distortion guarantee.

    Fix: Separate the shared goal of dimensionality reduction from the methods' different assumptions.

When explaining a random projection, name all of the roles explicitly: identify the finite set Q, distinguish the original dimension d from the target dimension n, identify the probability parameter δ, and describe W as the random matrix. Then state what is being preserved: pairwise Euclidean distances within controlled distortion.

Check Your Understanding

MEDIUM

Explain in your own words why the Johnson-Lindenstrauss Lemma is useful even though it does not preserve every distance exactly. In your answer, name the finite set, the lower target dimension, the probability parameter, and the random matrix.

Hints
  • Begin with the fact that a finite set of vectors is being considered.
  • Explain what changes when the vectors move from d dimensions to n dimensions.
  • Use the phrase controlled distortion rather than exact preservation.
  • Connect δ with the probabilistic nature of the guarantee.
EASY

Compare random projection with compressed sensing in two sentences. State the common goal first, then state the different assumption each method uses.

Hints
  • The common goal is a lower-dimensional description.
  • Random projection uses a random linear transformation and focuses on distance distortion.
  • Compressed sensing uses the assumption that a vector is sparse in some basis.

Key Takeaways

  • Random projection maps vectors from an original dimension d into a lower target dimension n using a random matrix W.
  • The Johnson-Lindenstrauss Lemma concerns a finite vector set and gives a high-probability guarantee about preserving pairwise Euclidean distances.
  • The guarantee allows controlled distortion within a factor of 1 ± ε rather than promising exact preservation.
  • The probability parameter δ expresses the failure-probability part of the lemma's setup.
  • Random projection and compressed sensing both reduce dimensionality, but compressed sensing additionally relies on sparsity in some basis.