Skip to content

Commit

Permalink
Merge pull request #54 from BoostV/53-show-expected-minimum-in-object…
Browse files Browse the repository at this point in the history
…ive-function

Read plot_objective "pars" from extras
  • Loading branch information
langdal authored Feb 7, 2023
2 parents 109e114 + e457d63 commit 5d7020c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions optimizerapi/openapi/specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ components:
extras:
description: A plain JSON object that can contain arbitrary values
type: object
properties:
objectivePars:
type: string
enum:
- result
- expected_minimum
data:
type: array
items:
Expand Down
5 changes: 4 additions & 1 deletion optimizerapi/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ def process_result(result, optimizer, dimensions, cfg, extras, data, space):
# as "None" at the moment.
graph_format = extras.get("graphFormat", "png")

objective_pars = extras.get("objectivePars", "result")

# In the following section details that should be reported to
# clients should go into the "resultDetails" dictionary and plots
# go into the "plots" list (this is handled by calling the "addPlot" function)
Expand All @@ -206,7 +208,8 @@ def process_result(result, optimizer, dimensions, cfg, extras, data, space):

plot_objective(model, dimensions=dimensions,
usepartialdependence=False,
show_confidence=True)
show_confidence=True,
pars=objective_pars)
add_plot(plots, f"objective_{idx}")

if optimizer.n_objectives == 1:
Expand Down

0 comments on commit 5d7020c

Please sign in to comment.