Hey Marco! If you check out the link to the code I provided to someone else who asked for it, the sklearn library uses PCA to transform your data into a new set of data with reduced features. As for choosing the number of dimensions, if I want to visualize it, I had to choose between 3 or 2. Of course, because we see the visualizations on a 2-d surface, a 3-d plot is usually ineffective, and if you check the explained variance ratio sum for three vs. two dimensions, having three dimensions does not add a lot of explained variance. Usually for PCA visualization, we choose two dimensions, unless adding the third dimension adds a lot of explained variance. Cheers!



ML enthusiast. Get my book: https://bit.ly/modern-dl-book. Join Medium through my referral link: https://andre-ye.medium.com/membership.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store