larch.numba.Model.set_values
larch.numba.Model.set_values¶
- Model.set_values(self, values=None, *, respect_holdfast=True, **kwargs)¶
Set the parameter values for one or more parameters.
- Parameters
values ({'null', 'init', 'best', array-like, dict, scalar}, optional) – New values to set for the parameters. If ‘null’ or ‘init’, the current values are set equal to the null or initial values given in the ‘nullvalue’ or ‘initvalue’ column of the parameter frame, respectively. If ‘best’, the current values are set equal to the values given in the ‘best’ column of the parameter frame, if that columns exists, otherwise a ValueError exception is raised. If given as array-like, the array must be a vector with length equal to the length of the parameter frame, and the given vector will replace the current values. If given as a dictionary, the dictionary is used to update kwargs before they are processed.
kwargs (dict) – Any keyword arguments (or if values is a dictionary) are used to update the included named parameters only. A warning will be given if any key of the dictionary is not found among the existing named parameters in the parameter frame, and the value associated with that key is ignored. Any parameters not named by key in this dictionary are not changed.
Notes
Setting parameters both in the values argument and through keyword assignment is not explicitly disallowed, although it is not recommended and may be disallowed in the future.
- Raises
ValueError – If setting to ‘best’ but there is no ‘best’ column in the pf parameters DataFrame.