Kenry Sanchez
Kenry Sanchez

Reputation: 1743

Similar python function of R Vif Function

lately I've been working with both R and Python for Analytics and Statics studies, so I was wondering what is the similar python function of R Vif Function.

Remember that the Vif function can help us to find...

The VIF of a predictor is a measure for how easily it is predicted from a linear regression using the other predictors.

Thank you and have all a good day!!

Upvotes: 0

Views: 166

Answers (1)

masrofin
masrofin

Reputation: 31

To get vif value in python:

from statsmodels.stats.outliers_influence import variance_inflation_factor

variables = lm.model.exog
vif = [variance_inflation_factor(variables, i) for i in 
range(variables.shape[1])]
vif 

Upvotes: 1

Related Questions