View source: R/parse_lambdas.R
parse_lambdas | R Documentation |
Parse Maxent .lambdas files to extract the types, weights, minima and maxima of features, as well as the fitted model's entropy and other values required for predicting to new data.
parse_lambdas(lambdas)
lambdas |
Either a |
A list (of class lambdas
) with five elements:
lambdas
: a data.frame
describing the features used in
a Maxent model, including their weights (lambdas), maxima, minima, and
type;
linearPredictorNormalizer
: a constant that ensures the
linear predictor (the sum of clamped features multiplied by their
respective feature weights) is always negative (for numerical stability);
densityNormalizer
: a scaling constant that ensures Maxent's
raw output sums to 1 over background points;
numBackgroundPoints
: the number of background points used in
model training; and
entropy
: the entropy of the fitted model.
Wilson, P. W. (2009) Guidelines for computing MaxEnt model output values from a lambdas file.
Maxent software for species habitat modeling, version 3.3.3k help file (software freely available here).
read_mxe()
project()
# 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, path=file.path(tempdir(), 'example'),
factors='biome')
# ... and then parse the lambdas information:
lam <- parse_lambdas(me)
lam
str(lam, 1)
parse_lambdas(file.path(tempdir(), 'example/species.lambdas'))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.