smac.optimizer.objective module

smac.optimizer.objective.average_cost(config, run_history, instance_seed_pairs=None)[source]

Return the average cost of a configuration.

This is the mean of costs of all instance-seed pairs.

Parameters:
  • config (Configuration) – Configuration to calculate objective for
  • run_history (RunHistory) – RunHistory object from which the objective value is computed.
  • instance_seed_pairs (list, optional (default=None)) – List of tuples of instance-seeds pairs. If None, the run_history is queried for all runs of the given configuration.
Returns:

Cost – Average cost

Return type:

float

smac.optimizer.objective.sum_cost(config: ConfigSpace.configuration_space.Configuration, run_history: smac.runhistory.runhistory.RunHistory, instance_seed_pairs=None)[source]

Return the sum of costs of a configuration.

This is the sum of costs of all instance-seed pairs.

Parameters:
  • config (Configuration) – Configuration to calculate objective for
  • run_history (RunHistory) – RunHistory object from which the objective value is computed.
  • instance_seed_pairs (list, optional (default=None)) – List of tuples of instance-seeds pairs. If None, the run_history is queried for all runs of the given configuration.
Returns:

sum_cost – Sum of costs of config

Return type:

float

smac.optimizer.objective.total_runtime(config: ConfigSpace.configuration_space.Configuration, run_history: smac.runhistory.runhistory.RunHistory, instance_seed_pairs=None)[source]

Return the total cost of a configuration.

This is the sum of costs of all instance-seed pairs.

Parameters:
  • config (Configuration) – Configuration to calculate objective for
  • run_history (RunHistory) – RunHistory object from which the objective value is computed.
  • instance_seed_pairs (list, optional (default=None)) – List of tuples of instance-seeds pairs. If None, the run_history is queried for all runs of the given configuration.
Returns:

Runtime – Sum of all costs

Return type:

float