| bm_ModelingOptions {biomod2} | R Documentation |
Configure the modeling options for each selected model
Description
Parameterize and/or tune biomod2's single models options.
Usage
bm_ModelingOptions(
data.type,
models = c("ANN", "CTA", "FDA", "GAM", "GBM", "GLM", "MARS", "MAXENT", "MAXNET", "RF",
"SRE", "XGBOOST"),
strategy,
user.val = NULL,
user.base = "bigboss",
bm.format = NULL,
calib.lines = NULL
)
Arguments
data.type |
a |
models |
a |
strategy |
a |
user.val |
(optional, default |
user.base |
(optional, default |
bm.format |
(optional, default |
calib.lines |
(optional, default |
Details
This function creates a BIOMOD.models.options object containing parameter values
for each single model that can be run within biomod2 through
BIOMOD_Modeling function.
12 models are currently available, and are listed within the ModelsTable dataset.
Different strategies are available to set those parameters, through the strategy
argument :
- default
all parameters names and values are directly retrieve from functions to be called through
formalArgsandformalsfunctions respectively- bigboss
default parameter values are updated with values predefined by biomod2 team
- user.defined
default parameter values are updated with values provided by the user
- tuned
default parameter values are updated by calling
bm_Tuningfunction
Value
A BIOMOD.models.options of object that can be used to build species
distribution model(s) with the BIOMOD_Modeling function.
Note
MAXENT being the only external model (not called through a R package),
default parameters, and their values, are the following :
-
path_to_maxent.jar = getwd(): acharactercorresponding to path tomaxent.jarfile -
memory_allocated = 512: anintegercorresponding to the amount of memory (in Mo) reserved forjavato runMAXENT, must be either64,128,256,512,1024... orNULLto use defaultjavamemory limitation parameter -
initial_heap_size = NULL: acharactercorresponding to initial heap space (shared memory space) allocated tojava(argument-Xmswhen callingjava), must be either1024K,4096M,10G... orNULLto use defaultjavaparameter. Used inBIOMOD_Projectionbut not inBIOMOD_Modeling. -
max_heap_size = NULL: acharactercorresponding to maximum heap space (shared memory space) allocated tojava(argument-Xmxwhen callingjava), must be either1024K,4096M,10G... orNULLto use defaultjavaparameter, and must be larger thaninitial_heap_size. Used inBIOMOD_Projectionbut not inBIOMOD_Modeling. -
background_data_dir = 'default': acharactercorresponding to path to folder where explanatory variables are stored asASCIIfiles (raster format). If specified,MAXENTwill generate its own background data from rasters of explanatory variables ('default'value). Otherwise biomod2 pseudo-absences will be used (seeBIOMOD_FormatingData). -
visible = FALSE: alogicalvalue defining whetherMAXENTuser interface is to be used or not -
linear = TRUE: alogicalvalue defining whether linear features are to be used or not -
quadratic = TRUE: alogicalvalue defining whether quadratic features are to be used or not -
product = TRUE: alogicalvalue defining whether product features are to be used or not -
threshold = TRUE: alogicalvalue defining whether threshold features are to be used or not -
hinge = TRUE: alogicalvalue defining whether hinge features are to be used or not -
l2lqthreshold = 10: anintegercorresponding to the number of samples at which quadratic features start being used -
lq2lqptthreshold = 80: anintegercorresponding to the number of samples at which product and threshold features start being used -
hingethreshold = 15: anintegercorresponding to the number of samples at which hinge features start being used -
beta_lqp = -1.0: anumericcorresponding to the regularization parameter to be applied to all linear, quadratic and product features (negative value enables automatic setting) -
beta_threshold = -1.0: anumericcorresponding to the regularization parameter to be applied to all threshold features (negative value enables automatic setting) -
beta_hinge = -1.0: anumericcorresponding to the regularization parameter to be applied to all hinge features (negative value enables automatic setting) -
beta_categorical = -1.0: anumericcorresponding to the regularization parameter to be applied to all categorical features (negative value enables automatic setting) -
betamultiplier = 1: anumericcorresponding to the number by which multiply all automatic regularization parameters (higher number gives a more spread-out distribution) -
defaultprevalence = 0.5: anumericcorresponding to the default prevalence of the modelled species (probability of presence at ordinary occurrence points)
Author(s)
Damien Georges, Wilfried Thuiller, Maya Gueguen
See Also
ModelsTable, BIOMOD.models.options,
bm_Tuning, BIOMOD_Modeling
Other Secundary functions:
bm_BinaryTransformation(),
bm_CrossValidation(),
bm_FindOptimStat(),
bm_MakeFormula(),
bm_PlotEvalBoxplot(),
bm_PlotEvalMean(),
bm_PlotRangeSize(),
bm_PlotResponseCurves(),
bm_PlotVarImpBoxplot(),
bm_PseudoAbsences(),
bm_RunModelsLoop(),
bm_SRE(),
bm_SampleBinaryVector(),
bm_SampleFactorLevels(),
bm_Tuning(),
bm_VariablesImportance()
Examples
library(terra)
# Load species occurrences (6 species available)
data(DataSpecies)
head(DataSpecies)
# Select the name of the studied species
myRespName <- 'GuloGulo'
# Get corresponding presence/absence data
myResp <- as.numeric(DataSpecies[, myRespName])
# Get corresponding XY coordinates
myRespXY <- DataSpecies[, c('X_WGS84', 'Y_WGS84')]
# Load environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
data(bioclim_current)
myExpl <- terra::rast(bioclim_current)
# ---------------------------------------------------------------#
# Format Data with true absences
myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
expl.var = myExpl,
resp.xy = myRespXY,
resp.name = myRespName)
# k-fold selection
cv.k <- bm_CrossValidation(bm.format = myBiomodData,
strategy = 'kfold',
nb.rep = 2,
k = 3)
# ---------------------------------------------------------------#
allModels <- c('ANN', 'CTA', 'FDA', 'GAM', 'GBM', 'GLM'
, 'MARS', 'MAXENT', 'MAXNET', 'RF', 'SRE', 'XGBOOST')
# default parameters
opt.d <- bm_ModelingOptions(data.type = 'binary',
models = allModels,
strategy = 'default')
# providing formated data
opt.df <- bm_ModelingOptions(data.type = 'binary',
models = allModels,
strategy = 'default',
bm.format = myBiomodData,
calib.lines = cv.k)
opt.d
opt.d@models
opt.d@options$ANN.binary.nnet.nnet
names(opt.d@options$ANN.binary.nnet.nnet@args.values)
opt.df@options$ANN.binary.nnet.nnet
names(opt.df@options$ANN.binary.nnet.nnet@args.values)
# ---------------------------------------------------------------#
# bigboss parameters
opt.b <- bm_ModelingOptions(data.type = 'binary',
models = allModels,
strategy = 'bigboss')
# user defined parameters
user.SRE <- list('_allData_allRun' = list(quant = 0.01))
user.XGBOOST <- list('_allData_allRun' = list(nrounds = 10))
user.val <- list(SRE.binary.biomod2.bm_SRE = user.SRE
, XGBOOST.binary.xgboost.xgboost = user.XGBOOST)
opt.u <- bm_ModelingOptions(data.type = 'binary',
models = c('SRE', 'XGBOOST'),
strategy = 'user.defined',
user.val = user.val)
opt.b
opt.u
## Not run:
# tuned parameters with formated data
opt.t <- bm_ModelingOptions(data.type = 'binary',
models = c('SRE', 'XGBOOST'),
strategy = 'tuned',
bm.format = myBiomodData)
opt.t
## End(Not run)