deepcave.evaluators.mo_lpi

# LPI

This module provides utilities to calculate the local parameter importance (LPI).

## Classes
  • LPI: This class calculates the local parameter importance (LPI).

Classes

MOLPI(run)

Calculate the multi-objective local parameter importance (LPI).

class deepcave.evaluators.mo_lpi.MOLPI(run)[source]

Bases: LPI

Calculate the multi-objective local parameter importance (LPI).

Override: to train the random forest with an arbitrary weighting of the objectives (multi-objective case).

Properties

runAbstractRun

The AbstractRun to get the importance from.

csConfigurationSpace

The configuration space of the run.

hp_namesList[str]

The names of the Hyperparameters.

variancesDict[Any, list]

The overall variances per tree.

importancesdict

The importances of the Hyperparameters.

continuous_neighborsint

The number of neighbors chosen for continuous Hyperparameters.

incumbentConfiguration

The incumbent of the run.

defaultConfiguration

A configuration containing Hyperparameters with default values.

incumbent_arraynumpy.ndarray

The internal vector representation of the incumbent.

seedint

The seed. If not provided it will be random.

rsRandomState

A random state with a given seed value.

calc_one_weighting()[source]

Prepare the data after a model has be trained for one weighting.

Returns:

imp_var_dict – Dictionary of importances and variances.

Return type:

Dict[str, Tuple[float, float]]

calculate(objectives=None, budget=None, continous_neighbors=500, n_trees=10, seed=0)[source]

Prepare the data and train a RandomForest model.

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.

  • continuous_neighbors (int, optional) – How many neighbors should be chosen for continuous hyperparameters (HPs). By default, 500.

  • n_trees (int, optional) – The number of trees for the fanova forest. Default is 10.

  • seed (Optional[int], optional) – The seed. By default None. If None, a random seed is chosen.

Return type:

None

get_importances_(hp_names)[source]

Return the importance scores from the passed Hyperparameter names.

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.

Returns:

Dictionary with Hyperparameter names and the corresponding importance scores and variances.

Return type:

Dict

Raises:

RuntimeError – If the important scores are not calculated.