SelfExplainML / PiML-Toolbox

PiML (Python Interpretable Machine Learning) toolbox for model development & diagnostics
https://selfexplainml.github.io/PiML-Toolbox
Apache License 2.0
931 stars 111 forks source link

Interpretation of L1 and L2 values in GLM options #24

Closed xloffree closed 1 year ago

xloffree commented 1 year ago

Hi,

What exactly do the L1 and L2 values refer to in the GLM model? Is it the lambda value or the lambda value multiplied by the alpha (or 1-alpha)? I got a result where the elastic net model selected zero variables, which was a very unexpected result. Consequently, I am suspecting that I am misinterpreting what the L1 and L2 values are referring to in PiML.

Thank you

CnBDM-Su commented 1 year ago

Hi @xloffree , With different L1 and L2, the GLM model will be changed.

For Lasso, alpha= l1, For Ridge, alpha=l2, For Elasticnet, alpha=l1+l2; l1_ratio= l1/ alpha

xloffree commented 1 year ago

Hi,

Thank you for the response.

When using PiML, if I have a lambda value of 0.1 and an alpha value of 0.5, what value should I enter in for L1 and L2 when using elastic net? Would it be 0.05?

Thank you

image