File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1536,7 +1536,7 @@ def _optimize_skopt() -> Union[pd.Series,
1536
1536
# Avoid recomputing re-evaluations:
1537
1537
# "The objective has been evaluated at this point before."
1538
1538
# https://github.com/scikit-optimize/scikit-optimize/issues/302
1539
- memoized_run = lru_cache ()(lambda tup : self .run (** dict (tup )))
1539
+ memoized_run = lru_cache ()(lambda tup : - maximize ( self .run (** dict (tup ) )))
1540
1540
1541
1541
# np.inf/np.nan breaks sklearn, np.finfo(float).max breaks skopt.plots.plot_objective
1542
1542
INVALID = 1e300
@@ -1549,8 +1549,7 @@ def objective_function(**params):
1549
1549
# TODO: Adjust after https://github.com/scikit-optimize/scikit-optimize/pull/971
1550
1550
if not constraint (AttrDict (params )):
1551
1551
return INVALID
1552
- res = memoized_run (tuple (params .items ()))
1553
- value = - maximize (res )
1552
+ value = memoized_run (tuple (params .items ()))
1554
1553
if np .isnan (value ):
1555
1554
return INVALID
1556
1555
return value
You can’t perform that action at this time.
0 commit comments