You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a production level pipeline using around 60 different models all fit with a relatively simple formula :y ~ x + z + (1 | id) , however some of the model files are massive (~2gb) because of the number of observations I use.
I need the model object to predict on new data. I am wondering what are the basic elements of the model object necessary for predict? I'd like to place them into a new, slimmer object and work from that. I have already taken a deductive approach, nullifying elements that contribute to a high object size (I got the 2gb file down to 119 mb) but wondering if I could take a better approach.
The text was updated successfully, but these errors were encountered:
Depending on what you need to do, you could make a very slim pipeline by saving only the coefficients and implementing your own predict method, i.e.
beta<- fixef(model)$condb<- getME(model, "b") ## needs development version of the packageX<- model.matrix(~x+z, newdata)
Z<- model.matrix(~0+id, newdata)
pred<-X%*%beta+Z%*%b
... but of course that doesn't get you things like back-transformation via the inverse link in a GLMM, standard errors of predictions, etc etc etc ...
I am building a production level pipeline using around 60 different models all fit with a relatively simple formula :
y ~ x + z + (1 | id)
, however some of the model files are massive (~2gb) because of the number of observations I use.I need the model object to
predict
on new data. I am wondering what are the basic elements of the model object necessary for predict? I'd like to place them into a new, slimmer object and work from that. I have already taken a deductive approach, nullifying elements that contribute to a high object size (I got the 2gb file down to 119 mb) but wondering if I could take a better approach.The text was updated successfully, but these errors were encountered: