Skip to content

Commit

Permalink
Fix varying configspace index order in PDP and symbolic explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Krebs committed Jan 15, 2024
1 parent 77e2246 commit 7777934
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Bug-Fixes
- Don't convert BOHB runs with status 'running' (consistent with SMAC).
- Fix varying configspace index order in PDP and symbolic explanations.

# Version 1.1.3

Expand Down
4 changes: 4 additions & 0 deletions deepcave/plugins/hyperparameter/pdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ def process(run, inputs):
surrogate_model = RandomForestSurrogate(run.configspace, seed=0)
surrogate_model.fit(X, Y)

# This is necessary as the run configspace can differ from the surrogate, which would be problematic as the
# surrogate configspace is used in the PDP and the run configspace for plotting in load_outputs()
surrogate_model.config_space = run.configspace

# Prepare the hyperparameters
selected_hyperparameters = [hp1]
if hp2 is not None and hp2 != "":
Expand Down
4 changes: 4 additions & 0 deletions deepcave/plugins/hyperparameter/symbolic_explanations.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ def process(run, inputs):
surrogate_model = RandomForestSurrogate(run.configspace, seed=0)
surrogate_model.fit(X, Y)

# This is necessary as the run configspace can differ from the surrogate, which would be problematic as the
# surrogate configspace is used in the PDP and the run configspace for plotting in load_outputs()
surrogate_model.config_space = run.configspace

# Prepare the hyperparameters
selected_hyperparameters = [hp1]
idx1 = run.configspace.get_idx_by_hyperparameter_name(hp1)
Expand Down

0 comments on commit 7777934

Please sign in to comment.