MCPcopy Index your code
hub / github.com/bayesian-optimization/BayesianOptimization / test_max

Function test_max

tests/test_target_space.py:217–226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

215
216
217def test_max():
218 PBOUNDS = {"p1": (0, 10), "p2": (1, 100)}
219 space = TargetSpace(target_func, PBOUNDS)
220
221 assert space.max() is None
222 space.probe(params={"p1": 1, "p2": 2})
223 space.probe(params={"p1": 5, "p2": 4})
224 space.probe(params={"p1": 2, "p2": 3})
225 space.probe(params={"p1": 1, "p2": 6})
226 assert space.max() == {"params": {"p1": 5, "p2": 4}, "target": 9}
227
228
229def test_max_with_constraint():

Callers

nothing calls this directly

Calls 3

maxMethod · 0.95
probeMethod · 0.95
TargetSpaceClass · 0.90

Tested by

no test coverage detected