History Logger

class evolib.utils.history_logger.HistoryLogger(columns=None)[source]

Bases: object

A flexible logger for recording per-generation statistics during evolutionary runs.

Automatically handles dynamic columns to support polymorphic ParaBase.get_history().

log(data)[source]

Logs a new row of generation data, automatically adding new columns if needed.

Parameters:

data (dict) – Dictionary of values to log for the current generation.

Return type:

None

reset()[source]

Clears the entire logged history.

Return type:

None

save_csv(path)[source]

Saves the current history to a CSV file.

Parameters:

path (str) – File path to save the history.

Return type:

None

to_dataframe()[source]

Returns the full history as a pandas DataFrame.

Return type:

DataFrame

to_dicts()[source]

Returns the full history as a list of dictionaries.

Return type:

List[Dict[str, Any]]