|
2 | 2 | import numpy as np
|
3 | 3 | import pandas as pd
|
4 | 4 |
|
5 |
| -# fmt: off |
| 5 | +ax_client = None |
| 6 | +batch_size = 2 |
| 7 | + |
6 | 8 | # single objective, single observation -------------------------------------------------
|
7 | 9 |
|
8 | 10 | objectives = ax_client.objective_names
|
9 | 11 | df = ax_client.get_trials_data_frame()[objectives]
|
10 | 12 |
|
11 |
| -trace = np.minimum.accumulate(df) # change if maximizing |
| 13 | +trace = np.minimum.accumulate(df) # change if maximizing |
12 | 14 |
|
13 | 15 | fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
|
14 | 16 | ax.scatter(df.index, df, ec="k", fc="none", label="Observed")
|
|
24 | 26 | df = ax_client.get_trials_data_frame()[objectives]
|
25 | 27 | df.index = df.index // batch_size
|
26 | 28 |
|
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 |
28 | 30 |
|
29 | 31 | fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
|
30 | 32 | ax.scatter(df.index, df, ec="k", fc="none", label="Observed")
|
|
44 | 46 |
|
45 | 47 | fig, ax = plt.subplots(figsize=(6, 4), dpi=200)
|
46 | 48 | 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 | +) |
48 | 56 | ax.set_xlabel(objectives[0])
|
49 | 57 | ax.set_ylabel(objectives[1])
|
50 | 58 | ax.legend()
|
|
59 | 67 | df = ax_client.get_trials_data_frame()[objectives]
|
60 | 68 | df = df[df.task == task].drop(columns=["task"])
|
61 | 69 |
|
62 |
| -trace = np.minimum.accumulate(df) # change if maximizing |
| 70 | +trace = np.minimum.accumulate(df) # change if maximizing |
63 | 71 |
|
64 | 72 | fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
|
65 | 73 | ax.scatter(df.index, df, ec="k", fc="none", label="Observed")
|
|
80 | 88 | df = df[df.task == task].drop(columns=["task"])
|
81 | 89 | df.index = df.index // batch_size
|
82 | 90 |
|
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 |
84 | 92 |
|
85 | 93 | fig, ax = plt.subplots(figsize=(6, 4), dpi=150)
|
86 | 94 | ax.scatter(df.index, df, ec="k", fc="none", label="Observed")
|
|
106 | 114 |
|
107 | 115 | fig, ax = plt.subplots(figsize=(6, 4), dpi=200)
|
108 | 116 | 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 | +) |
110 | 124 | ax.set_xlabel(objectives[0])
|
111 | 125 | ax.set_ylabel(objectives[1])
|
112 | 126 | ax.legend()
|
|
0 commit comments