The greatest variance is shown on an orthogonal line perpendicular to the axis. Likewise, the second greatest variation on the second axis, and so on.
This allows us to reduce the number of variables used in an analysis.
Taking this a step further – we can expand to higher level of dimensions – shown as “components”.
If we utilize a dataset with a large number of variables, this helps us reduce the amount of variation to a small number of components – but these can be tough to interpret. A much more detailed walk-through on the theory can be found here. I’m going to show how this analysis can be done utilizing Scikit learn in Python. The dataset were going to be utilizing can be loaded directly within sklearn as shown below.
WordPress conversion from Principal Component Analysis – Simple Example.ipynb by nb2wp v0.3.1