deepcave.evaluators.lpi¶
# LPI
This module provides utilities to calculate the local parameter importance (LPI).
- ## Classes
LPI: This class calculates the local parameter importance (LPI).
Classes
|
Calculate the local parameter importance (LPI). |
- class deepcave.evaluators.lpi.LPI(run)[source]¶
Bases:
object
Calculate the local parameter importance (LPI).
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.
- 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 importances.
- Parameters:
hp_names (List[str]) – Selected Hyperparameter names to get the importance scores from.
- Returns:
importances – Hyperparameter name and mean+var importance.
- Return type:
Dict[str, Tuple[float, float]]
- Raises:
RuntimeError – If the important scores are not calculated.