harrysouthworth / gbm

Gradient boosted models
Other
106 stars 27 forks source link

Added fold.id parameter #42

Open DexGroves opened 9 years ago

DexGroves commented 9 years ago

Allows user to determine their own CV groups. This is really useful in other packages, and not implemented in gbm as far as I can see. If fold.id is supplied, cv.folds can be left as default. Infers the number of folds from the number of unique levels in fold.id, overrides with a warning if cv.folds is > 0 and disagrees with the levels of fold.id. fold.id can be a vector of strings or numbers.

I also left the fold.id information in the gbm object, it would be cool to use this to get gbm.more to work nicely with cross-validated models.

Example here: https://gist.github.com/DexGroves/2faf30c758ed0cf1bede