Skip to content

Commit df03b0d

Browse files
peanutfuntovogt
andauthored
Update climada/util/calibrate/bayesian_optimizer.py
Use negative cost function as target function in BayesianOptimizer Co-authored-by: Thomas Vogt <[email protected]>
1 parent 68c421b commit df03b0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

climada/util/calibrate/bayesian_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __post_init__(
8686

8787
def _target_func(self, impact: Impact, data: pd.DataFrame) -> Number:
8888
"""Invert the cost function because BayesianOptimization maximizes the target"""
89-
return 1 / self.input.cost_func(impact, data)
89+
return -self.input.cost_func(impact, data)
9090

9191
def run(self, **opt_kwargs):
9292
"""Execute the optimization

0 commit comments

Comments
 (0)