% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/featured_space.R
\name{maxent_extract_lambdas}
\alias{maxent_extract_lambdas}
\title{Extract Lambda Values from a Maxent Run Result}
\usage{
maxent_extract_lambdas(run_result)
}
\arguments{
\item{run_result}{A named list as returned by \code{\link{maxent_run}}.
Must contain an element \code{model} holding the trained FeaturedSpace
external pointer.}
}
\value{
A named numeric vector of lambda values, one per feature.  Names
  are the feature names as stored in the model.
}
\description{
Retrieves the trained lambda (weight) coefficients from the output of
\code{\link{maxent_run}}, returning them as a named numeric vector.
Each element is the lambda value for the corresponding feature, and the
name of each element is the feature name (e.g. \code{"bio1"},
\code{"bio1^2"}, \code{"bio1'1"}).
}
\details{
The function reads lambdas directly from the trained model object, so
it also works correctly after reloading coefficients with
\code{\link{maxent_load_lambdas}}.
}
\examples{
\donttest{
stack_path      <- system.file("extdata", "stack_1_12_crop.rds",
                               package = "maxentcpp")
example_rasters <- terra::unwrap(readRDS(stack_path))
grids <- list(
  bio1  = maxent_grid_from_terra(example_rasters[[1]]),
  bio12 = maxent_grid_from_terra(example_rasters[[2]])
)
data(example_occ_df)

result <- maxent_run(
  species    = "Abeillia_abeillei",
  env_grids  = grids,
  occ_df     = example_occ_df,
  output_dir = tempdir(),
  lon_col    = "long",
  lat_col    = "lat")

lambdas <- maxent_extract_lambdas(result)
print(lambdas)
}
}
