I have a dataset of airbnb_final for EDA Calculate the VIF for each column and display the information. (Make E.C.?). However I am getting a type error for the same.
# 2.3.4 Calculate the VIF for each of the columns and display the information.(Make E.C.?)
vif = pd.DataFrame()
vif["Variable"] = df_numeric.columns
vif["VIF"] = [variance_inflation_factor(df_numeric.values, i) for i in range(df_numeric.shape[1])]
print("VIF values for each column is")
print(vif)
# 2.3.4 Calculate the VIF for each column and display the information.(Make E.C.?)
I was expecting VIF values for each columns. However I got this :
TypeError Traceback (most recent call last) <ipython-input-128-f8313dd1a1a0> in <cell line: 4>() 2 vif = pd.DataFrame() 3 vif["Variable"] = df_numeric.columns ----> 4 vif["VIF"] = [
New contributor
Aniruddh Guranna is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2