Skip to contents

Constructs a MaxEnt FeaturedSpace from background point data, occurrence sample indices, and a list of pre-built Feature objects.

Usage

maxent_featured_space(
  num_points,
  sample_indices,
  features,
  bias_weights = NULL
)

Arguments

num_points

Integer: total number of background points.

sample_indices

Integer vector: 0-based indices (into the background array) of the occurrence sample locations.

features

List of external pointers to Feature objects, as returned by maxent_linear_feature(), maxent_hinge_feature(), maxent_generate_features(), etc.

bias_weights

Optional numeric vector of per-point bias weights (length num_points). When supplied, background density is computed as bias[i] * exp(lp[i] - lpn) instead of the standard exp(lp[i] - lpn). This mirrors Java Maxent's biasFile parameter. Pass NULL (default) for uniform (unbiased) background.

Value

External pointer to a FeaturedSpace C++ object.

Examples

n   <- 100L
idx <- 90:99  # 0-based sample indices
env <- seq(0, 1, length.out = n)
f   <- maxent_linear_feature(env, "env1")
fs  <- maxent_featured_space(n, idx, list(f))