Skip to main content
added 330 characters in body
Source Link

When I read "the same coefficients" I'm thinking of comparing their weights in a linear regression. What if you one-hot-encoded thosechanged these categorical variables to dummy variables (since they're binary), applied a linear regression on these featuresyour 3 predictors and checked whether the coefficients on each leveldummy variable are similar ? Tell me if that wouldThat should solve your problem.

If you have the same weights for each leveldummy variable, then each level of theseit means that they have the same importance in the model. This is true because those are binary categorical variables contribute equally likely. Otherwise, if the sum of the weights ofthey were not you would have to check the levelscoefficients of each categorical variables arelevel of a one hot encoding.

For example : let's say you have beta_dummy_X2 = 10, beta_dummy_X3 = 10, beta_0 = -3. Then if dummy_X2 = 1 it affects your regression the same way (-3+10=+7) as if dummy_X3 = 1. If dummy_X2 = 0, the categorical variables contribute equally likely toit also affects the modelsame way (but their levels differ-3) as if dummy_X3 = 0. You only need approximate equality between beta_dummy_X2 and beta_dummy_X3.

When I read "the same coefficients" I'm thinking of comparing their weights in a linear regression. What if you one-hot-encoded those categorical variables, applied a linear regression on these features and checked whether the coefficients on each level are similar ? Tell me if that would solve your problem.

If you have the same weights for each level, then each level of these categorical variables contribute equally likely. Otherwise if the sum of the weights of the levels of each categorical variables are the same, the categorical variables contribute equally likely to the model (but their levels differ).

When I read "the same coefficients" I'm thinking of comparing their weights in a linear regression. What if you changed these categorical variables to dummy variables (since they're binary), applied a linear regression on your 3 predictors and checked whether the coefficients on each dummy variable are similar ? That should solve your problem.

If you have the same weights for each dummy variable, then it means that they have the same importance in the model. This is true because those are binary categorical variables, if they were not you would have to check the coefficients of each level of a one hot encoding.

For example : let's say you have beta_dummy_X2 = 10, beta_dummy_X3 = 10, beta_0 = -3. Then if dummy_X2 = 1 it affects your regression the same way (-3+10=+7) as if dummy_X3 = 1. If dummy_X2 = 0, it also affects the same way (-3) as if dummy_X3 = 0. You only need approximate equality between beta_dummy_X2 and beta_dummy_X3.

Source Link

When I read "the same coefficients" I'm thinking of comparing their weights in a linear regression. What if you one-hot-encoded those categorical variables, applied a linear regression on these features and checked whether the coefficients on each level are similar ? Tell me if that would solve your problem.

If you have the same weights for each level, then each level of these categorical variables contribute equally likely. Otherwise if the sum of the weights of the levels of each categorical variables are the same, the categorical variables contribute equally likely to the model (but their levels differ).