Principle component analysis (PCA) is an unsupervised machine learning algorithm, which is commonly used for data visualization. Specifically, if a model has a dataset with a lot of features, it is near impossible to plot this data after 5-10 dimensions. The algorithm reduces these features to just a few, so they can be easily plotted and visualized.

1_qFpLzGeW1wpVzgL5x49B5w.webp

In addition to data visualization, PCA is also sometimes used for data compression (though this is being becoming less often with data storage rising). It has also been used for speeding up training of a supervised learning model (typically support vector machines), though this has gotten less effective over time too.

Reducing the Number of Features

Defining the Algorithm

Implementing the Algorithm