Skip to contents

Overrides, queries, or resets the runtime policy consulted by edi_optimization_dispatch_policy() for which optimization algorithm ("newton_raphson", "lbfgs", or "irls") an inference class's C++ model-fitting backend uses by default; see get_optimization_dispatch_policy for the built-in default table and the empirical rationale behind its per-family choices.

Usage

set_optimization_dispatch_policy(policy = NULL, reset = FALSE)

Arguments

policy

Either NULL (no change) or a named list of policy overrides merged into the current configuration (see Details).

reset

If TRUE, discard all overrides and restore the built-in default policy.

Value

Invisible NULL when policy is supplied (a mutation), or invisibly the current policy configuration list when called for its side-effect-free query/reset value.

Details

Call with no arguments (policy = NULL, reset = FALSE) to retrieve the current configuration without changing it. Pass a named list to policy to merge new/overriding entries into the current configuration via modifyList (default_alg and/or inference_class_overrides can each be supplied independently). Pass reset = TRUE to discard any accumulated overrides and restore the package's built-in default policy exactly as returned by get_optimization_dispatch_policy. Note that this only changes the default algorithm consulted when a fitting call does not itself specify optimization_alg explicitly; an explicit per-call argument still takes precedence.

See also

get_optimization_dispatch_policy for the policy schema and built-in defaults; set_cold_start_dispatch_policy and set_warm_start_dispatch_policy for the analogous setters governing cold-start and warm-start behavior; tune_EDI_for_this_machine, which calls this setter with machine-measured, convergence-checked overrides rather than hand-picked ones.

Examples

set_optimization_dispatch_policy(reset = TRUE)