Closed Jeffrothschild closed 1 year ago
Hey @Jeffrothschild, thanks for the issue!
In general, we try to make the models and predictions work the same via tidymodels as they do via the engine implementation directly. So your intuition is not wrong. However, the goal of tidymodels is also to standardize across various implementations to reduce friction when going from one model (implementation) to another so sometimes that means we deviate from the default of the engine implementation.
For random effects models, a second tidymodels principle kicks in: it deliberately constrains predictions for new data to not use the training set or other data (to prevent information leakage). Thus, tidymodels uses only the “population effects”, i.e., no-subject specific random effects.
See also: http://multilevelmod.tidymodels.org/articles/multilevelmod.html#linear-mixed-effects-via-lme https://parsnip.tidymodels.org/reference/details_linear_reg_lmer.html#predicting-new-samples
Makes sense, thanks Hannah!
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.
When using the lmer engine, would it make more sense for the default predictions to be the same as the lmer default (re.form = NULL)? Currently the default uses re.form = NA
Perhaps there's a good reason I'm not aware of, but when adapting a lmer model into the tidymodels framework, I'd imagine most people would expect the predictions to default to the same as lmer.
Thanks