@@ -51,8 +51,7 @@ def to_objective_object(o, force_minimize=False, **kwargs):
51
51
52
52
53
53
def to_search_object (search_space , optimize_direction , searcher , searcher_options ,
54
- reward_metric = None , scorer = None , objectives = None , task = None , pos_label = None ):
55
-
54
+ reward_metric = None , scorer = None , objectives = None , task = None , pos_label = None ):
56
55
def to_searcher (cls , options ):
57
56
assert search_space is not None , '"search_space" should be specified if "searcher" is None or str.'
58
57
assert optimize_direction in {'max' , 'min' }
@@ -352,7 +351,7 @@ def append_early_stopping_callbacks(cbs):
352
351
353
352
if eval_data is not None :
354
353
from hypernets .experiment import MLEvaluateCallback
355
- if task in [const .TASK_REGRESSION , const .TASK_BINARY , const .TASK_MULTICLASS ]\
354
+ if task in [const .TASK_REGRESSION , const .TASK_BINARY , const .TASK_MULTICLASS ] \
356
355
and searcher .kind () == const .SEARCHER_SOO :
357
356
if evaluation_persist_prediction is True :
358
357
persist_dir = evaluation_persist_prediction_dir
@@ -371,7 +370,7 @@ def append_early_stopping_callbacks(cbs):
371
370
discriminator = make_discriminator (cfg .experiment_discriminator ,
372
371
optimize_direction = optimize_direction ,
373
372
** (cfg .experiment_discriminator_options or {}))
374
- elif discriminator is False :
373
+ elif isinstance ( discriminator , bool ) :
375
374
discriminator = None
376
375
377
376
if id is None :
0 commit comments