civisanalytics / python-glmnet

A python port of the glmnet package for fitting generalized linear models via penalized maximum likelihood.
Other
262 stars 59 forks source link

ENH: Surface more errors from the glmnet solver #29

Closed wlattner closed 6 years ago

wlattner commented 6 years ago

The glmnet solver uses integer codes to communicate errors and warnings. The error code returned by then solver is saved to the attribute jerr after fitting a model. Negative values denote warnings such as convergence issues, positive values denote fatal conditions such as memory allocation problems, and a value of zero is used when the solver runs successfully without error.

Initially we translated the convergence warnings into more complete messages from the numeric code. For all other errors, we just returned something opaque like "glmnet error no. 123."

In this PR, we add some additional messages and raise the relevant type of warning or exception.

xdavio commented 6 years ago

This probably isn't an issue, but I'm flagging it here for completeness: elnet errors and lognet errors are not exactly the same. But I think the general elnet errors you cover in this PR are the same for all the methods and are sufficient

wlattner commented 6 years ago

This probably isn't an issue, but I'm flagging it here for completeness: elnet errors and lognet errors are not exactly the same.

It's only a few additional messages. I'll update the PR to include these.

beckermr commented 6 years ago

Hi Bill! (disappear)