Skip to contents

This function returns a parsnip::model_spec for a Boosted Trees model to be used as a classifier of presences and absences in Species Distribution Model. It uses the library xgboost to fit boosted trees; to use another library, simply build the parsnip::model_spec directly.


sdm_spec_boost_tree(..., tune = c("sdm", "all", "custom", "none"))



parameters to be passed to parsnip::boost_tree() to customise the model. See the help of that function for details.


character defining the tuning strategy. Valid strategies are:

  • "sdm" chooses hyperparameters that are most important to tune for an sdm (for boost_tree: 'mtry', 'trees', 'tree_depth', 'learn_rate', 'loss_reduction', and 'stop_iter')

  • "all" tunes all hyperparameters (for boost_tree: 'mtry', 'trees', 'tree_depth', 'learn_rate', 'loss_reduction', 'stop_iter','min_n' and 'sample_size')

  • "custom" passes the options from '...'

  • "none" does not tune any hyperparameter


a parsnip::model_spec of the model.


standard_bt_spec <- sdm_spec_boost_tree()
full_bt_spec <- sdm_spec_boost_tree(tune = "all")
custom_bt_spec <- sdm_spec_boost_tree(tune = "custom", mtry = tune())