Bases: object
Wraps individual parameters.
This class represents a model’s parameter (in a somewhat broad sense). It acts as both a descriptor that can be assigned to a class attribute to describe the parameters accepted by an individual model (this is called an “unbound parameter”), or it can act as a proxy for the parameter values on an individual model instance (called a “bound parameter”).
Parameter instances never store the actual value of the parameter directly. Rather, each instance of a model stores its own parameters as either hidden attributes or (in the case of FittableModel) in an array. A bound Parameter simply wraps the value in a Parameter proxy which provides some additional information about the parameter such as its constraints.
Unbound Parameters are not associated with any specific model instance, and are merely used by model classes to determine the names of their parameters and other information about each parameter such as their default values and default constraints.
Parameters: | name : str
description : str
default : float or array
getter : callable
setter : callable
fixed : bool
tied : callable or False
min : float
max : float
bounds : tuple
model : object
|
---|
Attributes Summary
bounds | The minimum and maximum values of a parameter as a tuple |
constraints | Types of constraints a parameter can have. |
default | Parameter default value |
fixed | Boolean indicating if the parameter is kept fixed during fitting. |
max | A value used as an upper bound when fitting a parameter |
min | A value used as a lower bound when fitting a parameter |
name | Parameter name |
shape | The shape of this parameter’s value array. |
size | The size of this parameter’s value array. |
tied | Indicates that this parameter is linked to another one. |
value | The unadorned value proxied by this parameter |
Methods Summary
copy([name, description, default, getter, ...]) | Make a copy of this Parameter, overriding any of its core attributes in the process (or an exact copy). |
Attributes Documentation
The minimum and maximum values of a parameter as a tuple
Types of constraints a parameter can have. Excludes ‘min’ and ‘max’ which are just aliases for the first and second elements of the ‘bounds’ constraint (which is represented as a 2-tuple).
Parameter default value
Boolean indicating if the parameter is kept fixed during fitting.
A value used as an upper bound when fitting a parameter
A value used as a lower bound when fitting a parameter
Parameter name
The shape of this parameter’s value array.
The size of this parameter’s value array.
Indicates that this parameter is linked to another one.
A callable which provides the relationship of the two parameters.
The unadorned value proxied by this parameter
Methods Documentation
Make a copy of this Parameter, overriding any of its core attributes in the process (or an exact copy).
The arguments to this method are the same as those for the Parameter initializer. This simply returns a new Parameter instance with any or all of the attributes overridden, and so returns the equivalent of:
Parameter(self.name, self.description, ...)