1. Learn
  2. /
  3. Courses
  4. /
  5. Dimensionality Reduction in Python

Exercise

Features with low variance

In the previous exercise you established that 0.001 is a good threshold to filter out low variance features in head_df after normalization. Now use the VarianceThreshold feature selector to remove these features.

Instructions

100 XP
  • Create the variance threshold selector with a threshold of 0.001.
  • Normalize the head_df DataFrame by dividing it by its mean values and fit the selector.
  • Create a boolean mask from the selector using .get_support().
  • Create a reduced DataFrame by passing the mask to the .loc[] method.