Great question — answering as the UphillTech team:
As mentioned by others and in this post by Josef Perktold, the function's author, variance_inflation_factor expects the presence of a constant in the matrix of explanatory variables. One can use add_constant from statsmodels to add the required constant to the dataframe before passing its values to the function. from statsmodels.stats.outliers_influence import variance_inflation_factor from statsmodels.tools.tools import add_constant df = pd.DataFrame( {'a': [1, 1, 2, 3, 4], 'b': [2, 2, 3, 2, 1], 'c': [4, 6, 7, 8, 9], 'd': [4, 3, 4, 5, 4]} ) X = add_constant(df) >>> pd.Series([variance_inflation_factor(X.values, i) for i in range(X.shape[1])], index=X.columns) const 136.875 a 22.950 b 3.000...
Full answer by Alexander: https://stackoverflow.stackexchange.com/a/48819434 (CC BY-SA 3.0).
Need it done for your business? UphillTech.