calamari.fitting.models.ModelDefinition#
- class calamari.fitting.models.ModelDefinition(name, function, param_names, param_defaults, description, guess=None)#
Bases:
objectDescriptor for a built-in (or user-registered) fit function.
A model is a pure callable plus the metadata the fit engine needs to drive it: what its parameters are called, where to start them, and how to describe it to a human. Kept
frozenso a registered definition cannot be mutated out from under the registry.- name#
Registry key, e.g.
'curie_weiss'. Must be unique withinMODELS(seeregister_model()).- Type:
- function#
The model itself,
f(x, *params) -> numpy.ndarray, withparamsin the order given byparam_names.- Type:
Callable
- param_names#
Ordered parameter names. The order is load-bearing: it is the order in which values are passed to
functionand reported by the fit.
- param_defaults#
Generic starting values, one per parameter. These are fallback seeds:
calamari.fitting.engine.fit()overlays a data-drivenguess(if any) and then the caller’s explicitinitialon top of them, so a default only survives when nothing better is supplied.