0
$\begingroup$

I was tring to find a way to remove the redundant categorical variables as features. I believe GVIF would give high value for the redundant/multicollinear categorical variables. Please let me know if my thinking is correct, and also how do I calculate/interpret GVIF

Note: Using Python

$\endgroup$
0
$\begingroup$

After some searching , I can answer the first part myself.

I found the implementation of GVIF in R in the 'CAR' pacakage for vif funtion. following are the steps used to calculate the GVIF in that function:

  1. Create dummies (one hot encoding) for all categorical attributes.
  2. Drop one category for each categorical attribute, or else the final values will go haywire
  3. Let A be the correlation matrix of the one hot encoded variables of the attribute under consideration.
  4. Let B be the correlation matrix of all the other attributes in the data set (one hot encoded as well as numerical) excluding the ones in A.
  5. Let C be the correlation matrix of variables considered in A as well as B.
  6. GVIF = (det(A).det(B)) / det(C)
  7. Since these values will be large for categorical variables and small (usual VIF) for numerical values we have to have some scaling mechanism to compare them. We do so by calculating the following value:

    (GVIF) raised to (1/(2*degrees of freedom))

    where degrees of freedom = (categories in a attribute - 1) ; For numerical it is just 1

Cr:Fox & Monnet

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.