deepcave.evaluators.fanova

# fANOVA

This module provides a tool for assessing the importance of an algorithms Hyperparameters.

Utilities provide calculation of the data wrt the budget and train the forest on the encoded data.

## Classes
  • fANOVA: Calculate and provide midpoints and sizes.

Classes

fANOVA(run)

Calculate and provide midpoints and sizes.

class deepcave.evaluators.fanova.fANOVA(run)[source]

Bases: object

Calculate and provide midpoints and sizes.

They are generated from the forest’s split values in order to get the marginals.

Properties

runAbstractRun

The Abstract Run used for the calculation.

csConfigurationSpace

The configuration space of the run.

hpsList[Hyperparameters]

The Hyperparameters of the configuration space.

hp_namesList[str]

The corresponding names of the Hyperparameters.

n_treesint

The number of trees.

calculate(objectives=None, budget=None, n_trees=16, seed=0)[source]

Get the data with respect to budget and train the forest on the encoded data.

Note

Right now, only n_trees is used. It can be further specified if needed.

Parameters:
  • objectives (Optional[Union[Objective, List[Objective]]], optional) – Considered objectives. By default None. If None, all objectives are considered.

  • budget (Optional[Union[int, float]], optional) – Considered budget. By default None. If None, the highest budget is chosen.

  • n_trees (int, optional) – How many trees should be used. By default 16.

  • seed (int) – Random seed. By default 0.

Return type:

None

get_importances(hp_names=None, depth=1, sort=True)[source]

Return the importance scores from the passed Hyperparameter names.

Warning

Using a depth higher than 1 might take much longer.

Parameters:
  • hp_names (Optional[List[str]]) – Selected Hyperparameter names to get the importance scores from. If None, all Hyperparameters of the configuration space are used.

  • depth (int, optional) – How often dimensions should be combined. By default 1.

  • sort (bool, optional) – Whether the Hyperparameters should be sorted by importance. By default True.

Returns:

Dictionary with Hyperparameter names and the corresponding importance scores. The values are tuples of the form (mean individual, var individual, mean total, var total). Note that individual and total are the same if depth is 1.

Return type:

Dict[Union[str, Tuple[str, …]], Tuple[float, float, float, float]]

Raises:

RuntimeError – If there is zero total variance in all trees.