@@ -51,8 +51,7 @@ def to_objective_object(o, force_minimize=False, **kwargs):
5151
5252
5353def 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 ):
5655 def to_searcher (cls , options ):
5756 assert search_space is not None , '"search_space" should be specified if "searcher" is None or str.'
5857 assert optimize_direction in {'max' , 'min' }
@@ -352,7 +351,7 @@ def append_early_stopping_callbacks(cbs):
352351
353352 if eval_data is not None :
354353 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 ] \
356355 and searcher .kind () == const .SEARCHER_SOO :
357356 if evaluation_persist_prediction is True :
358357 persist_dir = evaluation_persist_prediction_dir
@@ -371,7 +370,7 @@ def append_early_stopping_callbacks(cbs):
371370 discriminator = make_discriminator (cfg .experiment_discriminator ,
372371 optimize_direction = optimize_direction ,
373372 ** (cfg .experiment_discriminator_options or {}))
374- elif discriminator is False :
373+ elif isinstance ( discriminator , bool ) :
375374 discriminator = None
376375
377376 if id is None :
0 commit comments