Description Usage Arguments Value Examples
Calculate the number of non-zero features used in a Maxent model.
1 | n_features(lambdas)
|
lambdas |
A |
An vector with one element for each element of lambdas
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Below we use the dismo::maxent example to fit a Maxent model:
if (require(dismo) && require(rJava) &&
file.exists(system.file('java/maxent.jar', package='dismo'))) {
fnames <- list.files(system.file('ex', package='dismo'), '\\.grd$',
full.names=TRUE )
predictors <- stack(fnames)
occurrence <- system.file('ex/bradypus.csv', package='dismo')
occ <- read.table(occurrence, header=TRUE, sep=',')[,-1]
me <- maxent(predictors, occ, args=c('hinge=false', 'threshold=false'),
path=file.path(tempdir(), 'ex1'))
n_features(me)
# comparing multiple models
me2 <- maxent(predictors, occ, args=c('betamultiplier=3'),
path=file.path(tempdir(), 'ex2'))
n_features(list(me, me2))
# or use lambdas files
ff <- file.path(tempdir(), c('ex1', 'ex2'), 'species.lambdas')
ff
n_features(ff)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.