Session Ready
Exercise

Using PCA

Let's apply PCA to the wine dataset, to see if we can get an increase in our model's accuracy.

Instructions
100 XP
  • Set up the PCA object. You'll use PCA on the wine dataset minus its label for Type, stored in the variable wine_X.
  • Apply PCA to wine_X using pca's fit_transform method and store the transformed vector in transformed_X.
  • Print out the explained_variance_ratio_ attribute of pca to check how much variance is explained by each component.