Skip to content

Commit

Permalink
update tutorials, and implement plotting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFalkowski committed Jan 28, 2025
1 parent 942b172 commit 572d157
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 154 deletions.
59 changes: 28 additions & 31 deletions docs/curriculum/tutorials/batch/batch-fullybayesian.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions docs/curriculum/tutorials/benchmarking/benchmarking.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 35 additions & 28 deletions docs/curriculum/tutorials/featurization/featurization.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
201 changes: 138 additions & 63 deletions docs/curriculum/tutorials/mobo/mobo.ipynb

Large diffs are not rendered by default.

Binary file modified docs/curriculum/tutorials/mobo/multi_objective_selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/curriculum/tutorials/multitask/multitask_selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/curriculum/tutorials/sobo/single_objective_selections.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 28 additions & 25 deletions docs/curriculum/tutorials/sobo/sobo.ipynb

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions src/honegumi/ax/main.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ best_parameters, metrics = ax_client.get_best_parameters()
# Plot results
objectives = ax_client.objective_names
df = ax_client.get_trials_data_frame()
{%- if synchrony == "Batch" and objective == "Single"%}
df.index = df.index // batch_size
{%- endif %}

fig, ax = plt.subplots(figsize=(6, 4), dpi=150)

Expand Down Expand Up @@ -374,17 +377,19 @@ pareto = pd.DataFrame(pareto_data).sort_values(objectives[0])
ax.scatter(df[objectives[0]], df[objectives[1]], fc="None", ec="k", label="Observed")
ax.plot(pareto[objectives[0]], pareto[objectives[1]], color="#0033FF", lw=2, label="Pareto Front")
ax.set_title(f"Task {task}")
ax.set_xlabel(objectives[0])
ax.set_ylabel(objectives[1])
{%- else %}
pareto = ax_client.get_pareto_optimal_parameters(use_model_predictions=False)
pareto_data = [p[1][0] for p in pareto.values()]
pareto = pd.DataFrame(pareto_data).sort_values(objectives[0])

ax.scatter(df[objectives[0]], df[objectives[1]], fc="None", ec="k", label="Observed")
ax.plot(pareto[objectives[0]], pareto[objectives[1]], color="#0033FF", lw=2, label="Pareto Front")
{%- endif %}

ax.set_xlabel(objectives[0])
ax.set_ylabel(objectives[1])
{%- endif %}

ax.legend()
plt.show()
{% endif %}
{% endif %}

0 comments on commit 572d157

Please sign in to comment.