[R] Saving fits (glm, nls) without data
Johann Hibschman
jhibschman at gmail.com
Tue Sep 7 17:02:30 CEST 2010
Is there any package that assists in saving and reconstituting glm and
nls fits without bringing along the accompanying data? A quick search
on CRAN didn't turn up anything.
If not, how do other people deal with saving the coefficients of model
fits?
For example, I've run a glm fit that has 23 coefficents on data set that
had 193,008 rows, by the time the fit was called. When I save the
resulting fit object, I get a 491 MB object, which suggests that it's
pulling along all sorts of junk in the environment, as 23*193k*8 is only
34 MB. Even so, I would prefer to only save the coefficients and the
Hessian, not the fit data set.
Is there anything I can do? If I want to save several fits, 490 MB a
shot starts to add up very quickly. If I just save the coefficients, I
have to manually hack up an object that I can then run 'predict' on when
I want to evaluate the model, and that feels very error-prone.
Thanks,
Johann
More information about the R-help
mailing list