for i, x in enumerate(x0):
// on the last iteration fit a model so we can start predicting
// unless there are random points to be evaluated next
fit_model = i == len(x0) - 1 and n_random_starts == 0
y = func(x)
optimizer.tell(x, y, fit=fit_model)
if callbacks:
After Change
// User suggested points at which to evaluate the objective first
if x0 and y0 is None:
y0 = list(map(func, x0))
if not all(map(np.isscalar, y0)):
raise ValueError(
"`y0` elements should be scalars")
optimizer.tell(x0, y0)