Closed jayrobwilliams closed 5 years ago
Thanks! This is definitely an important addition to brms and I will surely implement it. Currently, the up-to-date version of kfold_internal
is on the loo-compare
branch, which I will merge into master once the new loo version is on CRAN (hopefully tomorrow or so). Once that is done, I will add "grouped"
as an option in argument folds
.
Awesome!
This feature is now available on the loo-compare
branch, which is to be merged soon.
Currently
kfold
withfolds = "stratified"
places observations in the samegroup
in differentfolds
. The development version ofloo
now includes a functionloo::kfold_split_grouped
that will construct folds such that entire groups are either included or excluded in the folds. I've modifiedkfold_internal
to allow k-fold cross-validation that leaves entire groups out usingloo::kfold_split_grouped
.I've also modified
kfold_internal
to return groupwise instead of pointwise elpd standard errors following @avehtari's demo forrstanarm
here.I've done some limited tests and so far it doesn't look like anything I've done has broken
kfold_predict
. The modified function can be viewed on my forked repo under thekfold-grouped
branch. Would you have any interest in incorporating this functionality intobrms
?