diff --git a/vizier/_src/algorithms/designers/bocs.py b/vizier/_src/algorithms/designers/bocs.py index b5f708813..3f05cddef 100644 --- a/vizier/_src/algorithms/designers/bocs.py +++ b/vizier/_src/algorithms/designers/bocs.py @@ -313,6 +313,8 @@ def surrogate_model(self, x: np.ndarray) -> FloatType: # check if previous x led to Inf output (if so, barrier=Inf) barrier = 0. + if self._X_inf is None: + raise ValueError('You first need to call `regress()` on the data.') if self._X_inf.shape[0] != 0 and np.equal(x, self._X_inf).all(axis=1).any(): barrier = np.inf