Modelling clustered data using boosted regression trees I'm modelling habitat selection using boosted regression trees (BRTs), which I prefer over linear models for a variety of reasons (modeling complex nonlinear relationships and interactions, multicollinearity, etc.). I now have a dataset that includes repeated measures for individual animals (100s or 1000s per individual). In a linear modeling framework this is easily analyzed with random effects, but I haven't found any way to model clustered data with BRTs. 
I found methods that produce individual regression trees (e.g., Mixed Effect Regression Trees (MERT), Regression Trees with Random Effects (REEMtree)). But the only mention I've found of random effects with BRTs is in Buston and Elith 2011 (http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2656.2011.01803.x/abstract), who did a post-hoc residuals analysis to identify group effects.  Is there any way to account for clustering within the BRT analysis itself? Thanks!
 A: If you want to use boosted trees instead of linear models, you essentially have three options: (i) you can ignore the grouping structure, (ii) you can include the grouping structure (i.e. the animal ID in your case) as a categorical variable (this corresponds to using fixed effects), (iii) or you can use a boosting algorithm that explicitly accounts for the clustering structure using random effects.
Option (i) is in general not a good idea as you ignore potentially important information when ignoring the clustering. Also, option (ii), including the grouping ID (animal ID in your case) as a categorical variable, can have drawbacks: learning is not efficient when there are many categories and a relatively small number of samples per category, and tree algorithms can have problems with high-cardinality categorical variables. The third option avoids these issues.
The GPBoost library with Python and R packages builds on LightGBM and allows for combining tree-boosting and mixed effects models. Simply speaking it is an extension of linear mixed effects models where the fixed-effects are learned using tree-boosting. See this blog post and Sigrist (2020) for further information.
Disclaimer: I am the author of the GPBoost library.
