Machine Learning, Data Science, Algorithms, Dimensionality Reduction, Cheatsheet.
To select the number of components, the so-called elbow method is used. Plot a graph of the cumulative sum of the explained variance and then select the number of components that explains the desired ratio of information (usually 80% or 95%). PCA requires data scaling and centering