Principal Component Analysis — A numerical approach
Principal Component Analysis — A numerical approach
Become a member
21
In this blog, we are going to see how PCA works with a numerical example.
Principal Component Analysis (PCA) is a dimensionality reduction technique
commonly used in machine learning and data analysis to reduce the number
of features while preserving as much information as possible. It achieves
this by finding the principal components of the data, which are orthogonal
vectors that capture the most significant variations in the data.
1. Data Preparation:
4. Sort Eigenvalues:
Decide how many principal components to keep. You can select a specific
number or choose based on the explained variance (e.g., keep
components that explain 95% of the variance).
By applying the formula, we will get two roots and these are the eigen values.
Next step is to calculate eigen vectors. To calculate this the initial step is to
calculate the Characteristic Equation:
det(S — λI) = 0
where:
S is the covariance matrix.
Applying the above equation on the first eigen vector we will get the
following.
Step — 6 Projection onto Principal Components
Applying the equation on each data point.