Model-R / modleR

An ecological niche model workflow based on dismo
https://model-r.github.io/modleR
51 stars 23 forks source link

should ensemble_model() have boolean expression for model selection? #56

Open saramortara opened 5 years ago

saramortara commented 5 years ago

in cases that the user may want something like 0.7 <TSS < 1 or TSS > 0.7 & pval_pROC > 0.05?

AndreaSanchezTapia commented 5 years ago

currently the selection is peformed by subsetting an index vector

sel.index <- 1:n.part
sel.index <- which(stats.algo[, select_par] >= select_par_val)

this vector is then used to subset many portions of the following code tipo:

pond.stats <- stats.algo[, weight_par][sel.index]

to subset with an expression an option would be to use subset(), that receives an expression

select_expression = "TSS > 0.7"
base::subset(stats.algo, subset = select_expression)

and solve for the rest of the subsets or re-create the sel.index index, but still, an expression in the parameters is a character string that should be evaluated (there are many options for doing this, I was looking here)