0

I am doing logistic regression on a data set with dimensions 190000 X 53.(91Mb) mixed of categorical & numeric Data.

but i am facing serious issues of memory as R gets hang every time I run the logistic regression code.

I have tried to reduce the sample by taking only 10% of the data but R stuck again.

Error: cannot allocate vector of size 12.9 Gb

I have tried to increase the memory using memory.limit() and memory.size() but not getting any results

> memory.size()
[1] 152.98 

> memory.limit()
[1] 1.759219e+13

I am having 8Gb physical RAM but If i increase the memory using memory limit to 16GB then I get this error

> memory.limit(size=16000)
[1] 1.759219e+13
Warning message:
In memory.limit(size = 16000) : cannot decrease memory limit: ignored

can any one let me know how to solve the problem. I am using R 4.0.2 with windows 10(64Bit)

  • 1
    You probably have categorical variables with many levels. These are dummy encoded by `glm` using `model.matrix`, which creates many columns of 0/1 values and blows up your memory. Such a model is not sensible or useful anyway. Find a better approach. – Roland Aug 04 '20 at 09:19
  • Related post: https://stackoverflow.com/q/5171593/680068 – zx8754 Aug 04 '20 at 09:25

0 Answers0