-
Notifications
You must be signed in to change notification settings - Fork 104
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
Sparse to Dense #79
Comments
I have run into the exact same issue in my usage of Pylogit and had to work around it with a similar rewrite. I like your simple fix: it's very concise and will preserve the sparse matrix structure. Perhaps you can create a Pull request where you implement this exact fix and have Timothy review it. Here, make sure to include the same fix in |
Hi @brett1479 and @mathijsvdv, Does a similar trick also work for the mixed logit calculation? Because when estimating it, the dense array becomes super large. Using xlogit (or Stata's cmxtmixlogit) needs 1/20 of the memory pylogit requires. However, I need pylogit's feature for constrained optimization. Any help is very much appreciated! |
In
choice_calcs.py
line 930, it appears the library is callingrows_to_obs.toarray()
which converts a sparse array to a potentially huge dense array (for my use case, the resulting sparse array is small, and the dense version is about 200 GiB).Here is the existing code:
Is the intended behavior given below?
If so, I think this is a simple fix.
The text was updated successfully, but these errors were encountered: