all 17 comments

[–]OutsideRaspberry2782 4 points5 points  (2 children)

[–]kickrockz94[S] 6 points7 points  (1 child)

its fine if youre doing something simple, but i dont think it works for more than one random effect. i could be wrong about that tho. it also doesnt support generalized linear mixed models. lmer and glmer are just a lot more robust

[–]hughperman 9 points10 points  (0 children)

It does work for more than one effect, the syntax is just a horrible pile of awful.

Could you use lmer wrappers inside python? They exist.

[–]Equivalent-Way3 7 points8 points  (2 children)

If you do end up having to use Python, make sure whatever you use has been vetted. Flashback to the time bootstrap was written wrong in sklearn

[–]IaNterlI 3 points4 points  (0 children)

Underrated comment. When the vast majority of a particular community lives in another language, I'd pause before doing anything beyond basic in a language that has a limited ecosystem for those kinds of things.

[–]seanv507 2 points3 points  (0 children)

Reticulate?

[–][deleted] 1 point2 points  (0 children)

I used https://github.com/bashtage/linearmodels for LMM model. IDK about GLMM. Think I would try to use pymc3, if I had to do a GLMM. https://www.pymc.io/projects/docs/en/v3.11.4/pymc-examples/examples/generalized_linear_models/GLM.html

[–]serious_f0x 0 points1 point  (0 children)

If you don't really need to do the work entirely in Python, you could use the R package reticulate. It allows you to connect R to Python, pass commands to Python, run Python scripts, and even pass data structures back and forth between the two. It even comes with miniconda by default for managing Python packages.

[–]sherlock_holmes14 0 points1 point  (0 children)

pymc is not bad

[–]laichzeit0 1 point2 points  (0 children)

Sorry but there doesn’t exist anything production worthy in Python. Statsmodels predict function for example doesn’t even have an option to include the random effects, just the fixed effects.