You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GenericLikelihoodModelResults caches score_obs, but score_obs could be pretty large
@cache_readonly
def score_obsv(self):
"""cached Jacobian of log-likelihood
"""
return self.model.score_obs(self.params)
In general we have to decide when adding a lazy attribute whether to cache it or not, e.g. GLM caches all residual types. This has the trade-off between speed and memory, which will be different for small and large datasets.
One possibility: make caching of some intermediate results optional.
E,g. add a flag/attribute memory_low=True to reduce caching and recompute on repeated use.
Or use an attribute that allows more levels, memory_usage='low' 'medium' 'high' 'ultra-low'
(where ultra-low could be out of memory or working in patches as much as possible)
Current would be approximately medium
This would require that the cache decorator works conditional on this flag.
in betareg and similar me might want to cache distribution args and some predicted arrays that are not fittedvalues (i.e. predicted/conditional mean)
example Weibull or other distributions where mean is not a distribution parameter. (mean or median can be computed based on get_distribution)
caching is convenient for interactive work with small or medium sized datasets, but not for large datasets.
Activity
josef-pkt commentedon May 22, 2018
related: public option to remove items from cache #2417
jbrockmendel commentedon May 22, 2018
Related #4408 to distinguish between light and heavyweight entries (and inprove remove_data)
josef-pkt commentedon May 22, 2018
Did you really mean 4408 on multiple testing p-value corrections?
I don't see a connection.
jbrockmendel commentedon May 22, 2018
Typing with thumbs, try #4421
josef-pkt commentedon Aug 28, 2021
bump for another look
in betareg and similar me might want to cache distribution args and some predicted arrays that are not
fittedvalues(i.e. predicted/conditional mean)example Weibull or other distributions where mean is not a distribution parameter. (mean or median can be computed based on
get_distribution)caching is convenient for interactive work with small or medium sized datasets, but not for large datasets.