_parameters#

cultivars.engine._internals._parameters = <module 'cultivars.engine._internals._parameters' from '/home/runner/work/cultivars/cultivars/src/cultivars/engine/_internals/_parameters.py'>[source]#

the estimation context an objective function closes over.

An objective function is a closure over the estimation context — the data, the design blocks, the pre-sample constants, the specification orders. This module makes that context an object instead of a lexical scope, so the criterion, the parameter map, and the intermediate quantities every fit method needs after convergence are all reachable by name rather than trapped inside a def nested in a classmethod.

Each concrete objective is a frozen, slotted dataclass whose fields are exactly the variables the old closures captured, and whose methods are exactly the old closures. __call__ makes the instance directly passable to scipy.optimize.minimize() with no functools.partial and no args=.

The optimizer configuration lives on the objective, not at the call site, because the choice of algorithm is a property of the surface: a concentrated sum of squares that is non-smooth in the threshold wants Nelder-Mead, while a reparameterized Gaussian likelihood wants L-BFGS-B.

Type:

Optimizer surfaces