Skip to content

Commit aa9d018

Browse files
authored
Fix constraint probability checking wrong bound (#555)
1 parent a4103ff commit aa9d018

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bayes_opt/constraint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def predict(self, X: NDArray[Float]) -> NDArray[Float]:
203203
norm(loc=y_mean, scale=y_std).cdf(self._lb[0]) if self._lb[0] != -np.inf else np.array([0])
204204
)
205205
p_upper = (
206-
norm(loc=y_mean, scale=y_std).cdf(self._ub[0]) if self._lb[0] != np.inf else np.array([1])
206+
norm(loc=y_mean, scale=y_std).cdf(self._ub[0]) if self._ub[0] != np.inf else np.array([1])
207207
)
208208
result = p_upper - p_lower
209209
return result.reshape(X_shape[:-1])
@@ -215,7 +215,7 @@ def predict(self, X: NDArray[Float]) -> NDArray[Float]:
215215
norm(loc=y_mean, scale=y_std).cdf(self._lb[j]) if self._lb[j] != -np.inf else np.array([0])
216216
)
217217
p_upper = (
218-
norm(loc=y_mean, scale=y_std).cdf(self._ub[j]) if self._lb[j] != np.inf else np.array([1])
218+
norm(loc=y_mean, scale=y_std).cdf(self._ub[j]) if self._ub[j] != np.inf else np.array([1])
219219
)
220220
result = result * (p_upper - p_lower)
221221
return result.reshape(X_shape[:-1])

0 commit comments

Comments
 (0)