trainControlSDM: Control parameters for train

View source: R/trainControlSDM.R

trainControlSDMR Documentation

Control parameters for train

Description

Similar to the caret::trainControl, but with additional options

Usage

trainControlSDM(
  method = "boot",
  number = 10,
  repeats = NA,
  p = 0.75,
  y = NULL,
  spatial.folds = NULL,
  presence.only = FALSE,
  classProbs = TRUE,
  summaryFunction = twoClassSDM,
  ...
)

Arguments

method

one of 'cv', 'repeatedcv', 'boot', 'lgocv', 'none', 'adaptive_cv', 'adaptive_boot' and 'adaptive_lgocv'

number, repeats, p

Same as in caret::trainControl. Check its help file for more details.

y

Response variable. Only used if presence.only is TRUE. First level is assumed to be "presence" data.

spatial.folds

A vector or factor of fold designation. Must be same order as y, if supplield.

presence.only

If TRUE, only presence values are sampled for each method.

classProbs, summaryFunction

Same as in caret::trainControl, with different defaults.

...

Other parameters passed to trainControl.

Details

This function has two more keys arguments compared to caret::trainControl: 'spatial.folds' and 'presence.only'. When spatial.folds is specified, the sampling (as defined by method) is applied in all folds, except one. This fold is used as held-out is the model and the process is repeated for each fold.
When presence.only is set to TRUE, than the sampling is done only in the presence data, and all absence records are used in each replicate. This should be set to TRUE when using presence/background data.

Value

A trainControl object to be used in the 'train' function.


correapvf/caretSDM documentation built on June 2, 2022, 8:29 a.m.