3
$\begingroup$

I am an avid user of logistic regression and more specifically of penalised logistic regression. With standard penalisation (Ridge, Lasso, Elasticnet) the goal is to avoid overfitting and translates with a reduction of the number of variables used. Generally it will remove strongly correlated variables.

However I am in a case where I want to keep all my variable mostly unchanged and want to make sure that similar variables play a similar role in the model. Basically if I have two explanatory variables $X_1$ and $X_2$ such that $X_1 = X_2$ for all instance, I should have $\beta_1=\beta_2$ in my calibrated model. I am unsure this is enough to fully qualify what I want to achieve, but I hope you will get the idea.

Is there any framework to achieve that trough a specific "penalisation" term ?

$\endgroup$
7
  • $\begingroup$ This is not possible with LASSO etc.. $\endgroup$ Commented Sep 5, 2019 at 8:22
  • $\begingroup$ I don't think this would be a good idea for variables that are not perfectly collinear, because they still contain some independent information. $\endgroup$
    – mkt
    Commented Sep 5, 2019 at 8:49
  • $\begingroup$ Can you include why you want $\beta_1=\beta_2$ for similar features? I'm taking a wild guess here, but if you have groups of related variables, you may instead be interested in the group or fused penalty. $\endgroup$ Commented Sep 5, 2019 at 9:51
  • $\begingroup$ @FransRodenburg But doesn't group LASSO do the same thing as LASSO, that is reduce the coefficient values while keeping the groups intact? $\endgroup$ Commented Sep 5, 2019 at 11:22
  • $\begingroup$ @user2974951 I thought the OP might have some other goal in mind than what is written in the question. Group LASSO shrinks coefficients per group of predictors, which should indeed preserve groups. $\endgroup$ Commented Sep 5, 2019 at 12:35

1 Answer 1

1
$\begingroup$

A ridge/$\ell_2$ penalty achieves what you're asking for. Consider the case of duplicate features $X_1 = X_2$ as mentioned in the question. For any choice of some value $c$, all solutions where $\beta_1 X_1 + \beta_2 X_2 = c$ will have the same cost/likelihood (assuming weights for all other features are held constant). This is why ordinary logistic regression has no unique solution in this case. But, among the continuum of equivalent choices for $\beta_1$ and $\beta_2$, the $\ell_2$ norm of the weights is minimized when $\beta_1 = \beta_2$. Thus, $\ell_2$ penalized logistic regression would set these weights to be equal.

Contrary to what the question states, an $\ell_2$ penalty does not result feature selection or sparse weights as lasso or elastic net penalties do. But, it does encourage weights to have smaller magnitude than the maximum likelihood solution (called shrinkage). If you want sparse weights, use the elastic net. The $\ell_1$ component of the elastic net penalty will encourage sparsity, while the $\ell_2$ component will encourage similar features to have similar weights (for the same reason as above).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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