Skip to content
Prev 318891 / 398521 Next

lm Regression takes 24+ GB RAM - Error message

Le mercredi 06 mars 2013 ? 09:18 -0800, Jonas125 a ?crit :
7100*70/1024 = 485 (GB)

No wonder why you run out of memory quite fast.

You probably do not need to store the whole lm objects: usually you need
coefficients, R-squared, things like that. So instead of returning the
objects, return a vector or a list with only the elements you need, you
will save much space.

And if you really need the objects, set these lm() arguments to FALSE to
make the result smaller:
model, x, y, qr: logicals.  If ?TRUE? the corresponding components of
          the fit (the model frame, the model matrix, the response, the
          QR decomposition) are returned.
I don't understand why you think infinite values can trigger a memory
problem. Why don't you just try it?
Erreur dans lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 
  NA/NaN/Inf in 'y'
Erreur dans lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 
  NA/NaN/Inf in 'x'

So, if anything, this would stop your lapply() call sooner or later, and
save your machine from freezing.



Regards