mloptimizer.aux.tracker#

Module Contents#

Classes#

Tracker

Tracker class for logging and tracking the optimization process.

class mloptimizer.aux.tracker.Tracker(name, folder=os.curdir, log_file='mloptimizer.log', use_mlflow=False, use_parallel=False)[source]#

Tracker class for logging and tracking the optimization process.

Parameters:
  • name (str) – Name of the optimization process.

  • folder (str) – Folder where the optimization process will be stored.

  • log_file (str) – Name of the log file.

  • use_mlflow (bool) – If True, the optimization process will be tracked using MLFlow.

start_optimization(opt_class, generations: int)[source]#

Start the optimization process.

Parameters:
  • opt_class (str) – Name of the optimization class.

  • generations (int) – Number of generations for the optimization process.

start_checkpoint(opt_run_folder_name)[source]#

Start a checkpoint for the optimization process.

Parameters:

opt_run_folder_name (str) – Name of the folder where the checkpoint will be stored. (not the full path)

log_clfs(classifiers_list: list, generation: int, fitness_list: list[int])[source]#
log_evaluation(classifier, metrics)[source]#
load_checkpoint(checkpoint)[source]#
write_logbook_file(logbook, filename=None)[source]#

Method to write the logbook to a csv file

Parameters:
  • logbook (Logbook) – logbook of the optimization process

  • filename (str, optional (default=None)) – filename to save the logbook

write_population_file(populations: pandas.DataFrame, filename=None)[source]#

Method to write the population to a csv file

Parameters:
  • populations (pd.DataFrame) – population of the optimization process

  • filename (str, optional (default=None)) – filename to save the population

start_progress_file(gen: int)[source]#
append_progress_file(gen: int, ngen: int, c: int, evaluations_pending: int, ind_formatted, fit)[source]#