简体   繁体   中英

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!!

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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM