https://ddongwon.tistory.com/114
PCA (Principal Component Analysis) is a technique for dimensionality reduction. With PCA, we can map the data into a space with lower dimensionality.
The problem is that, dimensionality reduction inevitably accompanies information loss. Then, the question is how to conduct the dimensionality reduction such that we could minimize the loss. The PCA tries to tackle this problem
Say there is a 2-dimensional tabular data as shown below:


we find the vector that maximizes the sum of square
As shown below, for a single vector, we find the distance between the origin and the point made by projecting a data point to the vector. We sum up the squared values of all the data points. The vector that maximizes the sum of square can do this.

set the optimal line we found as PC1, and record the loading score.
In this example, the ratio between x and y axis is (0.97, 0.242). That is the loading score in this case.




Project the data to lower dimension space.

In this example, we reduce the dimensionality from 2 to 1.
However, if we would like to reduce the 3-dimensional data, say if we have PC1 (70%), PC2(20%), and PC3(10%), we can have 2 different choices: