opytimizer.utils.history¶
History-based object that helps in saving the optimization history.
-
class
opytimizer.utils.history.
History
(save_agents: Optional[bool] = False)¶ A History class is responsible for saving each iteration’s output.
Note that you can use dump() and parse() for whatever your needs. Our default is only for agents, best agent and best agent’s index.
-
__init__
(save_agents: Optional[bool] = False) → None¶ Initialization method.
Parameters: save_agents – Saves all agents in the search space.
-
save_agents
¶ Saves all agents in the search space.
-
_parse
(key: str, value: Any) → Union[List[Any], Tuple[List[Any], float]]¶ Parses incoming values with specified formats.
Parameters: - key – Key.
- value – Value.
Returns: Parsed value according to the specified format.
Return type: (Union[List[Any], Tuple[List[Any], float]])
-
dump
(**kwargs) → None¶ Dumps keyword pairs into self-class attributes.
-
get_convergence
(key: str, index: Optional[Tuple[int, ...]] = 0) → numpy.ndarray¶ Gets the convergence list of a specified key.
Parameters: - key – Key to be retrieved.
- index – Index to be retrieved.
Returns: Values based on key and index.
Return type: (np.ndarray)
-