Skip to content

Commit 5814360

Browse files
authored
Merge pull request #132 from automl/save-higher-resolution-plots
Bug/fix-some-minor-problems
2 parents 3c45d1a + 113a848 commit 5814360

File tree

18 files changed

+99
-20
lines changed

18 files changed

+99
-20
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Add exit button which first deletes running jobs and then terminates DeepCave.
1515
- Nicer handling of Keyboard Interrupt.
1616
- Disable debug mode.
17+
- Save plotly plots in higher resolution upon download.
1718

1819
## Bug-Fixes
1920
- Fix missing objective specification in LPI evaluator (#71).
@@ -25,6 +26,9 @@
2526
- When getting budget, objectives etc from multiple runs in Cost over Time and Pareto Front:
2627
- Instead of taking the first run as comparative value,
2728
- take the one with the lowest budget, else the index for the budgets could be out of bounds.
29+
- For PCP, show hyperparameters with highest importance closest to the cost, i.e. right (#124).
30+
- Add init files to all test directories.
31+
- Correct LPI importance tests.
2832

2933
## Documentation
3034
- Add How to Contribute section.

deepcave/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class Config:
5656
SAVE_IMAGES = False # The figure will be saved to the cache directory.
5757
FIGURE_MARGIN = dict(t=30, b=0, l=0, r=0)
5858
FIGURE_HEIGHT = "40vh"
59+
FIGURE_DOWNLOAD_SCALE = 4.0
5960

6061
# Redis settings
6162
REDIS_PORT: int = 6379

deepcave/plugins/budget/budget_correlation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ def get_output_layout(register: Callable) -> List[Any]:
220220
[
221221
dbc.Tab(
222222
dcc.Graph(
223-
id=register("graph", "figure"), style={"height": Config.FIGURE_HEIGHT}
223+
id=register("graph", "figure"),
224+
style={"height": Config.FIGURE_HEIGHT},
225+
config={
226+
"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}
227+
},
224228
),
225229
label="Graph",
226230
),

deepcave/plugins/hyperparameter/importances.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,11 @@ def get_output_layout(register: Callable) -> dcc.Graph:
357357
dcc.Graph
358358
Layout for the output block.
359359
"""
360-
return dcc.Graph(register("graph", "figure"), style={"height": Config.FIGURE_HEIGHT})
360+
return dcc.Graph(
361+
register("graph", "figure"),
362+
style={"height": Config.FIGURE_HEIGHT},
363+
config={"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}},
364+
)
361365

362366
@staticmethod
363367
def load_outputs(run, inputs, outputs) -> go.Figure: # type: ignore

deepcave/plugins/hyperparameter/pdp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,11 @@ def get_output_layout(register: Callable) -> dcc.Graph:
366366
dcc.Graph
367367
Layout for the output block.
368368
"""
369-
return dcc.Graph(register("graph", "figure"), style={"height": Config.FIGURE_HEIGHT})
369+
return dcc.Graph(
370+
register("graph", "figure"),
371+
style={"height": Config.FIGURE_HEIGHT},
372+
config={"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}},
373+
)
370374

371375
@staticmethod
372376
def get_pdp_figure( # type: ignore

deepcave/plugins/hyperparameter/symbolic_explanations.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,16 @@ def get_output_layout(register: Callable) -> List[dcc.Graph]:
491491
Layout for the output block.
492492
"""
493493
return [
494-
dcc.Graph(register("symb_graph", "figure"), style={"height": Config.FIGURE_HEIGHT}),
495-
dcc.Graph(register("pdp_graph", "figure"), style={"height": Config.FIGURE_HEIGHT}),
494+
dcc.Graph(
495+
register("symb_graph", "figure"),
496+
style={"height": Config.FIGURE_HEIGHT},
497+
config={"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}},
498+
),
499+
dcc.Graph(
500+
register("pdp_graph", "figure"),
501+
style={"height": Config.FIGURE_HEIGHT},
502+
config={"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}},
503+
),
496504
]
497505

498506
@staticmethod

deepcave/plugins/objective/configuration_cube.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,13 @@ def get_output_layout(register: Callable) -> Tuple[dcc.Graph,]:
294294
Tuple[dcc.Graph,]
295295
Layout for the output block.
296296
"""
297-
return (dcc.Graph(register("graph", "figure"), style={"height": Config.FIGURE_HEIGHT}),)
297+
return (
298+
dcc.Graph(
299+
register("graph", "figure"),
300+
style={"height": Config.FIGURE_HEIGHT},
301+
config={"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}},
302+
),
303+
)
298304

299305
@staticmethod
300306
def load_outputs(run, inputs, outputs) -> go.Figure: # type: ignore

deepcave/plugins/objective/cost_over_time.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,11 @@ def get_output_layout(register: Callable) -> dcc.Graph:
298298
dcc.Graph
299299
The layouts for the output block.
300300
"""
301-
return dcc.Graph(register("graph", "figure"), style={"height": Config.FIGURE_HEIGHT})
301+
return dcc.Graph(
302+
register("graph", "figure"),
303+
style={"height": Config.FIGURE_HEIGHT},
304+
config={"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}},
305+
)
302306

303307
@staticmethod
304308
def load_outputs(runs, inputs, outputs) -> go.Figure: # type: ignore

deepcave/plugins/objective/parallel_coordinates.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,9 @@ def process(run, inputs) -> Dict[str, Any]: # type: ignore
299299
evaluator.calculate(objective, budget, n_trees=10, seed=0)
300300
importances_dict = evaluator.get_importances()
301301
importances = {u: v[0] for u, v in importances_dict.items()}
302-
important_hp_names = sorted(importances, key=lambda key: importances[key], reverse=True)
302+
important_hp_names = sorted(
303+
importances, key=lambda key: importances[key], reverse=False
304+
)
303305
result["important_hp_names"] = important_hp_names
304306

305307
return result
@@ -320,7 +322,11 @@ def get_output_layout(register: Callable) -> dcc.Graph:
320322
dcc.Graph
321323
The layouts for the output block.
322324
"""
323-
return dcc.Graph(register("graph", "figure"), style={"height": Config.FIGURE_HEIGHT})
325+
return dcc.Graph(
326+
register("graph", "figure"),
327+
style={"height": Config.FIGURE_HEIGHT},
328+
config={"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}},
329+
)
324330

325331
@staticmethod
326332
def load_outputs(run, inputs, outputs) -> go.Figure: # type: ignore

deepcave/plugins/objective/pareto_front.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,11 @@ def get_output_layout(register: Callable) -> dcc.Graph:
352352
dcc.Graph
353353
The layout for the output block.
354354
"""
355-
return dcc.Graph(register("graph", "figure"), style={"height": Config.FIGURE_HEIGHT})
355+
return dcc.Graph(
356+
register("graph", "figure"),
357+
style={"height": Config.FIGURE_HEIGHT},
358+
config={"toImageButtonOptions": {"scale": Config.FIGURE_DOWNLOAD_SCALE}},
359+
)
356360

357361
@staticmethod
358362
def load_outputs(runs, inputs, outputs) -> go.Figure: # type: ignore

0 commit comments

Comments
 (0)