EasyDeepLearn

What does VarianceThreshold do and when is it useful?

easy

Answer

  • Drops features with variance below a threshold — most commonly zero-variance (constants) that carry no information.
  • Useful as a cheap pre-filter to remove degenerate features before training or before applying more expensive selection methods.
  • In high-dimensional sparse data (bag-of-words with rare terms), a low-variance filter (e.g., threshold = 0.01) can slash the feature count dramatically with almost no signal loss.
  • Doesn't consider the target — pair with a supervised method for real feature selection.
Check yourself — multiple choice
  • Rank features by correlation with y
  • Drop features with variance below a threshold — cheap pre-filter for degenerate features
  • Only used for classification
  • It replaces cross-validation

VarianceThreshold: kill zero/near-zero variance columns as a cheap pre-filter.

#feature-selection

Practise Supervised Learning

215 interview questions in this topic.

Related questions