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

Error when using dfmax option under certain conditions #9

Open
miguelcorrea opened this issue May 10, 2017 · 0 comments
Open

Error when using dfmax option under certain conditions #9

miguelcorrea opened this issue May 10, 2017 · 0 comments

Comments

@miguelcorrea
Copy link
Contributor

miguelcorrea commented May 10, 2017

The value of the parameter dfmax is supposed to be passed as a 1x1 scipy.ndarray.
Now, if we look at glmnet.py, starting from line 311:

ne = options['dfmax']
if len(ne) == 0:
    ne = nvars + 1
# check nx
nx = options['pmax']
if len(nx) == 0:
    nx = min(ne*2 + 20, nvars)

In the case that ne*2+20 is smaller than nvars, this makes nx an array too. This leads to problems later. For example, line 111 of lognet.py:
ca = scipy.zeros([nx, nc, nlam], dtype = scipy.float64)
Which in this case gives us the error:
TypeError: only integer scalar arrays can be converted to a scalar index

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

1 participant