Skip to content

Commit ccd5ebf

Browse files
committed
precommit
1 parent ff92c45 commit ccd5ebf

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

scripts/refreshers/plot_honegumi.py

+21-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
import numpy as np
33
import pandas as pd
44

5-
# fmt: off
5+
ax_client = None
6+
batch_size = 2
7+
68
# single objective, single observation -------------------------------------------------
79

810
objectives = ax_client.objective_names
911
df = ax_client.get_trials_data_frame()[objectives]
1012

11-
trace = np.minimum.accumulate(df) # change if maximizing
13+
trace = np.minimum.accumulate(df) # change if maximizing
1214

1315
fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
1416
ax.scatter(df.index, df, ec="k", fc="none", label="Observed")
@@ -24,7 +26,7 @@
2426
df = ax_client.get_trials_data_frame()[objectives]
2527
df.index = df.index // batch_size
2628

27-
trace = np.minimum.accumulate(df.groupby(df.index).min()) # change if maximizing
29+
trace = np.minimum.accumulate(df.groupby(df.index).min()) # change if maximizing
2830

2931
fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
3032
ax.scatter(df.index, df, ec="k", fc="none", label="Observed")
@@ -44,7 +46,13 @@
4446

4547
fig, ax = plt.subplots(figsize=(6, 4), dpi=200)
4648
ax.scatter(df[objectives[0]], df[objectives[1]], fc="None", ec="k", label="Observed")
47-
ax.plot(pareto[objectives[0]], pareto[objectives[1]], color="#0033FF", lw=2, label="Pareto Front")
49+
ax.plot(
50+
pareto[objectives[0]],
51+
pareto[objectives[1]],
52+
color="#0033FF",
53+
lw=2,
54+
label="Pareto Front",
55+
)
4856
ax.set_xlabel(objectives[0])
4957
ax.set_ylabel(objectives[1])
5058
ax.legend()
@@ -59,7 +67,7 @@
5967
df = ax_client.get_trials_data_frame()[objectives]
6068
df = df[df.task == task].drop(columns=["task"])
6169

62-
trace = np.minimum.accumulate(df) # change if maximizing
70+
trace = np.minimum.accumulate(df) # change if maximizing
6371

6472
fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
6573
ax.scatter(df.index, df, ec="k", fc="none", label="Observed")
@@ -80,7 +88,7 @@
8088
df = df[df.task == task].drop(columns=["task"])
8189
df.index = df.index // batch_size
8290

83-
trace = np.minimum.accumulate(df.groupby(df.index).min()) # change if maximizing
91+
trace = np.minimum.accumulate(df.groupby(df.index).min()) # change if maximizing
8492

8593
fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
8694
ax.scatter(df.index, df, ec="k", fc="none", label="Observed")
@@ -106,7 +114,13 @@
106114

107115
fig, ax = plt.subplots(figsize=(6, 4), dpi=200)
108116
ax.scatter(df[objectives[0]], df[objectives[1]], fc="None", ec="k", label="Observed")
109-
ax.plot(pareto[objectives[0]],pareto[objectives[1]],color="#0033FF",lw=2,label="Pareto Front",)
117+
ax.plot(
118+
pareto[objectives[0]],
119+
pareto[objectives[1]],
120+
color="#0033FF",
121+
lw=2,
122+
label="Pareto Front",
123+
)
110124
ax.set_xlabel(objectives[0])
111125
ax.set_ylabel(objectives[1])
112126
ax.legend()

0 commit comments

Comments
 (0)