Skip to content

Commit

Permalink
Return zero importance if incumbent is predicted worse than default i…
Browse files Browse the repository at this point in the history
…n ablation paths
  • Loading branch information
Sarah Krebs committed Aug 29, 2024
1 parent 0af965c commit cddf748
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions deepcave/evaluators/mo_ablation.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ def calculate(
# calculate importance for each weighting generated from the pareto efficient points
for w in weightings:
df_res = self.calculate_ablation_path(df, objectives_normed, w, budget)
if df_res is None:
columns = ["hp_name", "importance", "variance", "new_performance", "weight"]
self.df_importances = pd.DataFrame(0, index=np.arange(len(self.hp_names) + 1),
columns=columns)
self.df_importances["hp_name"] = ["Default"] + self.hp_names
return
df_res["weight"] = w[0]
self.df_importances = pd.concat([self.df_importances, df_res])
self.df_importances = self.df_importances.reset_index(drop=True)
Expand Down
2 changes: 1 addition & 1 deletion examples/api/ablation_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

objective_id1 = run.get_objective_ids()[0]
objective_id2 = run.get_objective_ids()[1]
budget_id = run.get_budget_ids()[0]
budget_id = run.get_budget_ids()[1]

# Instantiate the plugin
plugin = AblationPaths()
Expand Down

0 comments on commit cddf748

Please sign in to comment.