📅  最后修改于: 2022-03-11 14:45:05.184000             🧑  作者: Mango
vif = pd.DataFrame()
vif['Features'] = X_train.columns
vif['VIF'] = [variance_inflation_factor(X_train.values, i) for i in range(X_train.shape[1])]
vif['VIF'] = round(vif['VIF'], 2)
vif.sort_values(by = 'VIF', ascending = False, inplace = True)
print(vif)