// Bounds
num_params = len(bounds)
lower_bounds, upper_bounds = extract_bounds(bounds)
// Default estimator
if base_estimator is None:
After Change
http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.OptimizeResult.html
rng = check_random_state(random_state)
space = Space(dimensions)
// Default estimator
if base_estimator is None:
base_estimator = GradientBoostingQuantileRegressor(random_state=rng)
// Record the points and function values evaluated as part of
// the minimization
Xi = np.zeros((maxiter, space.n_dims))
yi = np.zeros(maxiter)
// Initialize with random points
if n_start == 0:
raise ValueError("Need at least one starting point.")
if maxiter == 0:
raise ValueError("Need to perform at least one iteration.")
n_start = min(n_start, maxiter)
Xi[:n_start] = space.rvs(n_samples=n_start, random_state=rng)
yi[:n_start] = [func(xi) for xi in Xi[:n_start]]
i = np.argmin(yi[:n_start])
best_y = yi[i]
best_x = Xi[i]
models = []