Skip to content

Commit 0a31ebd

Browse files
committed
Modify n_EI_candidates in Hyperopt
1 parent 6f36d29 commit 0a31ebd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pkg/suggestion/v1beta1/hyperopt/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class OptimizerConfiguration:
6969
'tpe': {
7070
'gamma': lambda x: float(x),
7171
'prior_weight': lambda x: float(x),
72-
'n_EI_candidates': lambda x: int(x),
72+
'n_ei_candidates': lambda x: int(x),
7373
"random_state": lambda x: int(x),
7474
},
7575
"random": {
@@ -107,9 +107,9 @@ def _validate_tpe_setting(cls, algorithm_settings):
107107
elif s.name == 'prior_weight':
108108
if not float(s.value) > 0:
109109
return False, "prior_weight should be great than zero"
110-
elif s.name == 'n_EI_candidates':
110+
elif s.name == 'n_ei_candidates':
111111
if not int(s.value) > 0:
112-
return False, "n_EI_candidates should be great than zero"
112+
return False, "n_ei_candidates should be great than zero"
113113
elif s.name == 'random_state':
114114
if not int(s.value) >= 0:
115115
return False, "random_state should be great or equal than zero"

test/suggestion/v1beta1/test_hyperopt_service.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_get_suggestion(self):
143143
value="1.0"
144144
),
145145
api_pb2.AlgorithmSetting(
146-
name="n_EI_candidates",
146+
name="n_ei_candidates",
147147
value="24"
148148
),
149149
],
@@ -220,7 +220,7 @@ def test_validate_algorithm_settings(self):
220220
value="1.0"
221221
),
222222
api_pb2.AlgorithmSetting(
223-
name="n_EI_candidates",
223+
name="n_ei_candidates",
224224
value="24"
225225
),
226226
]
@@ -270,19 +270,19 @@ def test_validate_algorithm_settings(self):
270270
self.assertEqual(code, grpc.StatusCode.INVALID_ARGUMENT)
271271
self.assertEqual(details, "gamma should be in the range of (0, 1)")
272272

273-
# Invalid n_EI_candidates value.
273+
# Invalid n_ei_candidates value.
274274
experiment_spec = api_pb2.ExperimentSpec(
275275
algorithm=api_pb2.AlgorithmSpec(
276276
algorithm_name="tpe",
277277
algorithm_settings=[
278-
api_pb2.AlgorithmSetting(name="n_EI_candidates", value="0")
278+
api_pb2.AlgorithmSetting(name="n_ei_candidates", value="0")
279279
]
280280
)
281281
)
282282

283283
_, _, code, details = utils.call_validate(self.test_server, experiment_spec)
284284
self.assertEqual(code, grpc.StatusCode.INVALID_ARGUMENT)
285-
self.assertEqual(details, "n_EI_candidates should be great than zero")
285+
self.assertEqual(details, "n_ei_candidates should be great than zero")
286286

287287
# Invalid random_state value.
288288
experiment_spec = api_pb2.ExperimentSpec(

0 commit comments

Comments
 (0)