1
$\begingroup$

I have come across a function in sklearn called VarianceThreshold(). Is this related to the variance_inflation_factor() function in statsmodels?

If they are different, what exactly is the difference between both the functions?

$\endgroup$

2 Answers 2

1
$\begingroup$

VarianceThreshold() simply drops the features that don't vary much (or at all). VIF estimates multicollinearity by regressing a feature against other features (high VIF = a feature is well explained by other features).

$\endgroup$
1
  • $\begingroup$ Thanks for the clarification. Cleared up a lot of confusion in my mind. $\endgroup$ Jul 6, 2022 at 16:31
0
$\begingroup$

The variance threshold is a simple baseline approach to feature selection. It removes all features which variance doesn’t meet some threshold. By default, it removes all zero-variance features, i.e., features that have the same value in all samples.

While on the other hand

The variance inflation factor is a measure for the increase of the variance of the parameter estimates if an additional variable, given by exog_idx is added to the linear regression. It is a measure for multicollinearity of the design matrix, exog

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.