Skip to content

memory usage tipping point #23

@Geoff-Holmes

Description

@Geoff-Holmes

Hi Gianluca

I have run into a problem when trying to build a model and have recreated it below using the bc data augmented with some dummy variables.

Both model 7 and model 9 below are trained very fast with little memory overhead (from the viewpoint of Windows task manager).
Model 8 however, which includes all the terms from 7 and 9, doesn't complete due to eating up my 4GB of spare working memory.

# get some data
data(bc)
N<-nrow(bc)

# create some dummy categorical variables
bc$x1<-round(2*runif(N))
bc$x2<-round(3*runif(N))

# create some 'continuous' variables
bc$x3<-round(10*runif(N))
bc$x4<-round(33*runif(N))

# create indicator variables for the levels of categorical variables to allow interactions
bc$x1.1<-as.factor(bc$x1==1)
bc$x1.2<-as.factor(bc$x1==2)
bc$x2.1<-as.factor(bc$x2==1)
bc$x2.2<-as.factor(bc$x2==2)
bc$x2.3<-as.factor(bc$x2==3)

# create interactions
bc$x1.x2<-as.factor(bc$x1*bc$x2)
bc$x1.1.x3<-as.numeric(bc$x1.1)*bc$x3
bc$x1.2.x3<-as.numeric(bc$x1.2)*bc$x3

# modelling with interaction of categorical variables
   form7<-with(bc, Surv(rectime, censrec)~group+x1.1+x1.2+x2.1+x2.2+x2.3+x1.x2+x3+x4)
      m7<-fit.models(form7, data=bc, distr="rps", k=1)
print(m7)

# modelling with interactions of categorical variable with categorical and continuous variable
   form8<-with(bc, Surv(rectime, censrec)~group+x1.1+x1.2+x2.1+x2.2+x2.3+x1.x2+x3+x4+x1.1.x3+x1.2.x3)
      m8<-fit.models(form8, data=bc, distr="rps", k=1)
print(m8)

# modelling with interaction of categorical variable with continuous variable
   form9<-with(bc, Surv(rectime, censrec)~group+x1.1+x1.2+x3+x1.1.x3+x1.2.x3)
      m9<-fit.models(form9, data=bc, distr="rps", k=1)
print(m9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions