Week 10
Useful Facts
Throughout, \(\bfG\in\Rbb^{k\times d}\) has independent \(N(0,1)\) entries, and \[ f(\bfx)=\frac{1}{\sqrt k}\,\bfG\bfx\in\Rbb^k. \] You may use the following facts without proof.
For a fixed nonzero \(\bfu\in\Rbb^d\), the ratio \(\|f(\bfu)\|^2/\|\bfu\|^2\) has exactly the distribution of \(Z_k\), as shown in the sum of squared Gaussians example.
Problem 1
Suppose \(f\) satisfies the conclusion of Theorem 2 for \(\bfx_1,\ldots,\bfx_n\), with some \(\varepsilon\in(0,1)\). Show that distinct data points have distinct images: if \(\bfx_i\neq\bfx_j\), then \(f(\bfx_i)\neq f(\bfx_j)\).
Problem 2
In Theorem 2, the dataset is fixed first, and only then is \(\bfG\) drawn. This problem shows that the order matters.
Suppose \(k<d\). After \(\bfG\) has been drawn, an adversary who can see \(\bfG\) gets to choose data points.
- Show that for any point \(\bfx\in\Rbb^d\), the adversary can choose a point \(\bfy\neq\bfx\) with \(f(\bfy)=f(\bfx)\).
- Conclude the following, for every \(\varepsilon\in(0,1)\).
- No single \(\bfG\) satisfies the conclusion of Theorem 2 for every dataset of two points, however \(\bfG\) was drawn.
- Even if \(f\) satisfies the conclusion of Theorem 2 for \(\bfx_1,\ldots,\bfx_n\), the adversary can add a point \(\bfx_{n+1}\) so that \(f\) no longer satisfies it for \(\bfx_1,\ldots,\bfx_{n+1}\).
Problem 3
A common use of random projections is to speed up nearest-neighbour search. Fix a query point \(\bfx=\bfx_1\) among the data, and consider the remaining points \(\bfx_2,\ldots,\bfx_n\) as candidates. Let \(\bfy^*\) be the nearest candidate to \(\bfx\) in the original space, and let \(\hat\bfy\) be the candidate whose image is nearest to \(f(\bfx)\). Suppose \(f\) satisfies the conclusion of Theorem 2 for \(\bfx_1,\ldots,\bfx_n\).
- Show that if a candidate \(\bfx_j\) satisfies \[ \|\bfx-\bfx_j\|^2>\frac{1+\varepsilon}{1-\varepsilon}\,\|\bfx-\bfy^*\|^2, \] then \(\bfx_j\) cannot be \(\hat\bfy\).
- Deduce that \(\|\bfx-\hat\bfy\|^2\leq\frac{1+\varepsilon}{1-\varepsilon}\|\bfx-\bfy^*\|^2\): the projected search returns an approximate nearest neighbour.
Problem 4
The concentration theorem is not only useful for random projections! Applied directly to random data, it says that in high dimensions, independent Gaussian points are all nearly the same distance apart.
Let \(\bfx_1,\ldots,\bfx_n\in\Rbb^d\) be random points whose \(nd\) entries \(x_{il}\) are independent \(N(0,1)\) random variables. No projection appears in this problem: the randomness is in the data, and the dimension \(d\) plays the role that \(k\) played in Theorem 2.
- Using Proposition 1, show that for each pair \(i\neq j\), the ratio \(\|\bfx_i-\bfx_j\|^2/(2d)\) has the distribution of \(Z_d\).
- Fix \(\varepsilon\in(0,1)\) and a pair \(i\neq j\). Using Theorem 1, show that \[ \Pr\Big(\|\bfx_i-\bfx_j\|^2\notin\big[(1-\varepsilon)\,2d,\;(1+\varepsilon)\,2d\big]\Big)\leq2e^{-d\varepsilon^2/8}. \]
- Now fix \(\delta\in(0,1)\) as well, and suppose \[ d\geq\frac{8}{\varepsilon^2}\left(2\log n+\log\frac1\delta\right). \] Using Proposition 2, show that, with probability at least \(1-\delta\), simultaneously for every pair \(i\neq j\), \[ (1-\varepsilon)\,2d\leq\|\bfx_i-\bfx_j\|^2\leq(1+\varepsilon)\,2d. \]
Problem 5
Can we run \(k\)-means on the projected data instead of the original data? To avoid a clash with the target dimension \(k\), we partition the data into \(m\) clusters \(S_1,\ldots,S_m\). Recall from lecture that the within-cluster sum of squares of a partition is \[ \operatorname{WCSS}(S_1,\ldots,S_m)=\sum_{\ell=1}^m\sum_{i\in S_\ell}\|\bfx_i-\bar\bfx_{S_\ell}\|^2. \] Write \(\operatorname{WCSS}_f\) for the same quantity computed from the projected points \(f(\bfx_1),\ldots,f(\bfx_n)\).
Suppose \(f\) satisfies the conclusion of Theorem 2 for \(\bfx_1,\ldots,\bfx_n\).
- Show that for every partition, \[ (1-\varepsilon)\operatorname{WCSS}(S_1,\ldots,S_m) \leq\operatorname{WCSS}_f(S_1,\ldots,S_m) \leq(1+\varepsilon)\operatorname{WCSS}(S_1,\ldots,S_m). \]
- Let \(\hat S_1,\ldots,\hat S_m\) be a partition minimizing \(\operatorname{WCSS}_f\), and let \(S_1^*,\ldots,S_m^*\) be a partition minimizing \(\operatorname{WCSS}\). Show that \[ \operatorname{WCSS}(\hat S_1,\ldots,\hat S_m)\leq\frac{1+\varepsilon}{1-\varepsilon}\operatorname{WCSS}(S_1^*,\ldots,S_m^*). \] So the best clustering of the projected data, used on the original data, costs at most a factor \(\frac{1+\varepsilon}{1-\varepsilon}\) more than the best clustering of the original data.
Hint for part 1: In Homework 6, Problem 3 you showed that for every non-empty \(S\subseteq[n]\), \[ \sum_{i\in S}\|\bfx_i-\bar\bfx_S\|^2=\frac{1}{2|S|}\sum_{i\in S}\sum_{j\in S}\|\bfx_i-\bfx_j\|^2. \]