Principal Component Analysis(PCA) in Machine Learning & Python

MD RASHEDIN
2 min readSep 28, 2022

--

Source

→ Principal component analysis is a technique that dimensionality of datasets increasing interpretability but at the same time minimizing information loss.

in PCA, we find the best “picture” or “projection” of the data points.

Basically it reduces the dimensionality of large datasets.

Source of Image

How PCA works :-

→ PCA performs the following operations in order to evaluate the principal component for a given dataset.

  • Standardization — The main aim of this step is to standardize the range of the attributes so that each of them lie within similar boundaries.
  • Covariance Matrix Computation — Covariance matrix is used to express the correlation between any two or more attributes in a multidimensional test. Covariance tells us how the two or more variables are related.
  • Eigen Values and Eigen Vector — Eigen values and Eigen vectors are the mathematical values that are extracted from the covariance table. They are responsible for the generation of new set of variables from old set of variables which further lead to the construction of principal component. Eigen Values are the scalars or the magnitude of the Eigen vectors. Eigen Vectors do not change directions after linear transformation.
  • Feature Vectors — Feature vector is simply a matrix that has Eigen vectors of the component that we decide to keep as the columns.

Now here is link of my source code google colab file, everything is define there, and most importantly if you find anything wrong please let me know I’ll be Happy to Learn.

Link → https://colab.research.google.com/drive/10d-vQMI-7QEUfUGSQoDtZtvBceuzY00f?usp=sharing

My LinkedIn account don’t hesitate to connect with me.

Thank You.

--

--