Why does the PCA algorithm subtract the mean from the data before continuing?
The PCA algorithm subtracts the mean from the data to centralize it, meaning that the mean of all points should be zero. This step prepares the data for the variance-based step that follows, making the formula for the scatter matrix simpler.
Conditions
- The data must first be represented as a matrix X.
- The subtraction is by the mean .
- After this step, the video uses in the scatter-matrix discussion.
Reasoning, step by step
- Represent the data as a matrix X.
- Subtract the mean from the data: X -> X - .
- Observe that the scatter plot shifts so that the cloud sits around the origin.
- Conclude that the mean of all points is now zero, which simplifies the subsequent scatter matrix calculation.
Example
The board writes X -> X - , and the scatter plot is shifted so that the cloud sits around the origin instead of in the upper-right quadrant. The narration explains the purpose of this transformation: after subtracting the mean, the mean of all points is zero.
Common misconceptions
- One might read as the general formula without conditions. In this clip, the formula is presented after centralization, with written alongside it.
Watch the explanation
2:53 – 3:05Watch this moment ↗
Explore next
Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.