deepcave.runs.group

# Group

This module provides utilities for grouping and managing a group of runs. Utilities include getting attributes of the grouped runs, as well as the group itself.

## Classes
  • Group: Can group and manage a group of runs.

Classes

Group(name, runs)

Can group and manage a group of runs.

class deepcave.runs.group.Group(name, runs)[source]

Bases: AbstractRun

Can group and manage a group of runs.

Utilities include getting attributes of the grouped runs, as well as the group itself.

Properties

runsList[AbstractRun]

A list of the runs.

metaDict[str, Any]

Contains budgets, objectives and their attributes.

configspaceConfigurationSpace

The configuration space of the runs.

objectivesObjective

The objectives of the runs.

budgetsList[Union[int, float]]

The budgets of the runs.

configsDict[int, Any]

A dictionary of the configurations and their ids as key.

originsDict[int, str]

The origins of the configurations and their ids as key.

trial_keysDict[Tuple[str, int], int]

The keys of the trial.

historyList[Trial]

The trial history.

prefixstr

The prefix for the id of the group.

namestr

The name for the id of the group.

__iter__()[source]

Allow to iterate over the object.

Return type:

Iterator[str]

get_model(config_id)[source]

Get the model given the configuration id.

Parameters:

config_id (int) – The identificator of the configuration.

Returns:

The model.

Return type:

Optional[Any]

get_new_config_id(run_id, original_config_id)[source]

Get a new identificator for a configuration.

Parameters:
  • run_id (int) – The id of the run.

  • original_config_id (int) – The original identificator of a configuration.

Returns:

The new identificator of a configuration.

Return type:

int

get_original_config_id(config_id)[source]

Get the original identificator of a configuration.

Parameters:

config_id (int) – The identificator of a configuration.

Returns:

The original identificator of a configuration.

Return type:

int

get_original_run(config_id)[source]

Get the original run.

Parameters:

config_id (int) – The identificator of the configuration.

Returns:

The original run.

Return type:

AbstractRun

get_runs()[source]

Get the runs in the group.

Returns:

A list of the grouped runs.

Return type:

List[AbstractRun]

get_trajectory(*args, **kwargs)[source]

Calculate the trajectory of the given objective and budget.

This includes the times, the mean costs, and the standard deviation of the costs.

Parameters:
  • *args – Should be the objective to calculate the trajectory from.

  • **kwargs – Should be the budget to calculate the trajectory for.

Returns:

  • times (List[float]) – Times of the trajectory.

  • costs_mean (List[float]) – Costs of the trajectory.

  • costs_std (List[float]) – Standard deviation of the costs of the trajectory.

  • ids (List[int]) – The “global” ids of the selected trial.

  • config_ids (List[int]) – The configuration ids of the selected trials.

property hash: str

Sorted hashes of the group.

Returns:

The sorted hash of the group.

Return type:

str

property id: str

Get the hash as id of the group.

In contrast to hash, this hash should not be changed throughout the run.

Returns:

The hash of the group.

Return type:

str

property latest_change: float

Get the latest change made to the grouped runs.

Returns:

The latest change.

Return type:

float

property run_names: List[str]

Get the names of the runs in the group.

Returns:

A list of the names of the runs in the group.

Return type:

List[str]

property run_paths: List[str]

Get the path of the runs in the group.