tidymodels / multilevelmod

Parsnip wrappers for mixed-level and hierarchical models
https://multilevelmod.tidymodels.org/
Other
74 stars 3 forks source link

Using multilevelmod to enable butcher to understand lme4 #11

Closed bshor closed 3 years ago

bshor commented 3 years ago

I am trying to use the butcher package to cut down on the size of fitted objects, in my case fits using lme4::lmer. That led me to parsnip, then here!

I would have thought this would work, but it doesn't.

library(multilevelmod)
#> Loading required package: parsnip
data(sleepstudy, package = "lme4")

mixed_model_spec <- linear_reg() %>% set_engine("lmer")

mixed_model_fit <- 
  mixed_model_spec %>% 
  fit(Reaction ~ Days + (Days | Subject), data = sleepstudy)

mixed_model_fit

Checking the size of the fits:

> object.size(mixed_model_fit)
67120 bytes
> object.size(butcher(mixed_model_fit))
67120 bytes

What am I missing?

juliasilge commented 3 years ago

Hello there @bshor! The methods for butchering aren't here in multilevelmod but in butcher, so we'll need to track this in that repo. Related to tidymodels/butcher#198.

github-actions[bot] commented 3 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.