MCPcopy
hub / github.com/hyperopt/hyperopt / test_space_eval

Function test_space_eval

hyperopt/tests/unit/test_fmin.py:96–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94
95
96def test_space_eval():
97 space = hp.choice(
98 "a",
99 [
100 ("case 1", 1 + hp.lognormal("c1", 0, 1)),
101 ("case 2", hp.uniform("c2", -10, 10)),
102 ],
103 )
104
105 assert space_eval(space, {"a": 0, "c1": 1.0}) == ("case 1", 2.0)
106 assert space_eval(space, {"a": 1, "c2": 3.5}) == ("case 2", 3.5)
107
108
109def test_set_fmin_rstate():

Callers

nothing calls this directly

Calls 1

space_evalFunction · 0.90

Tested by

no test coverage detected