File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class Optimizer:
7676 Seed value for the random number generator of the sampler.
7777 Defaults to no seed.
7878 average_case : `bool`, optional
79- Optimize for average case (default).
79+ Optimize for average case (default).
8080 Set to False to optimize for worst case.
8181 """
8282
@@ -148,7 +148,12 @@ def __init__(
148148 @property
149149 def best_loss (self ) -> float :
150150 """Return best loss so far"""
151- return self .study_ .best_value
151+ try :
152+ best_value = self .study_ .best_value
153+ except Exception :
154+ direction : int = 1 if self .pipeline .get_direction () == "minimize" else - 1
155+ best_value = direction * np .inf
156+ return best_value
152157
153158 @property
154159 def best_params (self ) -> dict :
You can’t perform that action at this time.
0 commit comments