Skip to content

Commit

Permalink
adapt importance and ablation api example to multi-objective
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Krebs committed Aug 29, 2024
1 parent 8a205da commit ce5102a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions examples/api/ablation_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
# Instantiate the run
run = DeepCAVERun.from_path(Path("logs/DeepCAVE/minimal/run_2"))

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

# Instantiate the plugin
plugin = AblationPaths()
inputs = plugin.generate_inputs(
objective_id=objective_id,
objective_id1=objective_id1,
objective_id2=None, # replace with objective_id2 for multi-objective importance
budget_id=budget_id,
n_hps=100,
n_trees=100,
Expand Down
6 changes: 4 additions & 2 deletions examples/api/importances.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
# Instantiate the run
run = DeepCAVERun.from_path(Path("logs/DeepCAVE/minimal/run_2"))

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

# Instantiate the plugin
plugin = Importances()
inputs = plugin.generate_inputs(
hyperparameter_names=list(run.configspace.keys()),
objective_id=objective_id,
objective_id1=objective_id1,
objective_id2=None, # replace with objective_id2 for multi-objective importance
budget_ids=budget_ids,
method="global",
n_hps=3,
Expand Down

0 comments on commit ce5102a

Please sign in to comment.