Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regularization of GLM weights for input driven observations and transitions #149

Open
sarathnayar opened this issue Aug 8, 2022 · 1 comment

Comments

@sarathnayar
Copy link

I see that for InputDrivenObservations, there are parameters prior_mean and prior_sigma which governs strength of the prior on GLM weights. Does this act as an L2 regularization? Otherwise, if I were to add an L1 or L2 penalty or a custom regularizer on the GLM weights, should I add the regularization term only in the calculation of log_prior or also in the _objective, _gradient, and _hess functions?

@slinderman
Copy link
Collaborator

Looking at the code, it doesn't look like prior_mean actually gets used in the M step! It only gets used in the calculation of log_prior(), which is used for tracking convergence of EM. On the other hand, prior_sigma does get used, and it specifies the scale of the L2 regularization though. If you wanted to add L1 regularization you'd have to make the change in all of the functions you listed. However, there are better optimization methods for mixed L1/L2 regularization than the trust_ncg method used in this implementation. It could be a lot of work... it might be better to call into an off-the-shelf optimizer like cvxpy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants