Skip to content

Commit 69ed227

Browse files
committed
Minor change to PCA
1 parent 7846ffa commit 69ed227

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ML.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,11 +1604,11 @@ \subsection{Dimensionality Reduction}
16041604
More formally we want to project a set of datapoints $X = (x_1, \cdots, x_N)$ (which we'll assume are normalized) onto a linear space $L = L(u_1, \cdots, u_K)$.
16051605

16061606
Let's consider first $L = L(u)$.
1607-
In this case, we want $\max_u \sum_{n=1}^N ||u^T x_n||^2 = \max_u u^T \Sigma u$ where $\Sigma = \frac{1}{N} \sum_{n=1}^N x_n x_n^T$ is the data covariance matrix.
1607+
In this case, we want $\max_u \sum_{n=1}^N ||u^T x_n||^2 = \max_u u^T \Sigma u$ where $\Sigma = \frac{1}{N} \sum_{n=1}^N x_n x_n^T = \frac{1}{N} X X^T$ is the data covariance matrix.
16081608
Imposing a normalization condition to prevent that $||u|| \to \infty$, we get that to maximize the above value $u$ corresponds to the eigenvector with the largest eigenvalue $\lambda_1$ for $\Sigma$.
16091609

16101610
Note that we can now apply the same reasoning to the orthogonal projection of $L$ to extract the most information from that that was not captured by $L$.
1611-
Thus, the PCA algorithm works essentially by finding the $K$ eigenvectors of the covariance matrix $\Sigma$ with largest eigenvalue.
1611+
Thus, the PCA algorithm works essentially by finding the $K$ eigenvectors of the covariance matrix $\Sigma = \frac{1}{N} X X^T$ with largest eigenvalue.
16121612

16131613
Note that the computational cost of computing the full eigenvector decomposition for a matrix of size $D \times D$ is $O(D^3)$.
16141614
If we plan to project our data onto the first $K$ principal components, then we only need $O(M D^2)$.

0 commit comments

Comments
 (0)