IterationHistory
#
- class pybads.utils.IterationHistory(keys: list)[source]#
This class is responsible for storing the history information for each iteration of PyBADS.
- Parameters:
- keyslist
The keys that can be recorded with this object.
- record(key: str, value: object, iteration: int)[source]#
Store a value for a key in a given iteration.
- Parameters:
- keystr
The key for which the value should be stored.
- valueobject
The value which should be stored.
- iterationint
The iteration for which the value should be stored, must be >= 0.
- Raises:
- ValueError
Raised if the value of the iteration is < 0.
- ValueError
Raised if a key has not been specified on initialization of the object.
- record_iteration(key_value: dict, iteration: int)[source]#
Convenience method to record multiple key-values for a given iteration.
- Parameters:
- key_valuedict
The keys and values that should be recorded. They keys must have been specified on initialization of the object.
- iterationint
The iteration for which the value should be stored, must be >= 0.
- Raises:
- ValueError
Raised if the value of the iteration is < 0.
- ValueError
Raised if a key has not been specified on initialization of the object