-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add "lean" argument to feols()
and fepois()
#547
Comments
Good that you mention this, it is bothering me as well 😀 note that you can already economize a bit by setting 'store_date=False' and 'copy_data=False', though this still saves a range of large-memory attributes. I suppose an argument 'lean=True' should also drop the Y and X attributes and garbage collection memory. Should be an easy enough addition =) |
feols()
and feöo
feols()
and feöo
feols()
and fepois()
ContextQuite a lot of large objects are stored in TaskAdd the end of the run_all_models method of the
In code, do something as import gc
if lean:
del self._X
del self._Y
del self._Z
del self._cluster_df
del self._data
gc.collect() |
👏 |
Done 👍 You can now specify a %load_ext autoreload
%autoreload 2
import pyfixest as pf
data = pf.get_data()
fit = pf.feols("Y ~ X1", data = data, lean = True)
hasattr(fit, "_X")
# False |
(unless I somehow missed this) fixest has a lean parameter to strip the result of large components eating a lot of memory. It's really useful for large computations, where using pyfixest results in oom errors.
The text was updated successfully, but these errors were encountered: