00cce06892217b891c8a85ead8c51b28d556bd64,skopt/gp_opt.py,,gp_minimize,#,33

Before Change


            print("Current minimum: %0.4f" % np.min(yi))

    // Pack results
    res = OptimizeResult()
    best = np.argmin(yi)
    res.x = Xi[best]
    res.fun = yi[best]
    res.func_vals = np.array(yi)
    res.x_iters = Xi
    res.models = models
    res.space = space
    res.random_state = rng
    res.specs = specs

    return res

After Change


                print("Function value obtained: %0.4f" % curr_y)
                print("Current minimum: %0.4f" % np.min(y0))

            if callback is not None:
                callback(pack_optimize_result(x0, y0, space, rng, specs))

    elif x0:
        if isinstance(y0, Iterable):
            y0 = list(y0)
        elif isinstance(y0, numbers.Number):
            y0 = [y0]
        else:
            raise ValueError(
                "`y0` should be an iterable or a scalar, got %s" % type(y0))
        if len(x0) != len(y0):
            raise ValueError("`x0` and `y0` should have the same length")
        if not all(map(np.isscalar, y0)):
            raise ValueError(
                "`y0` elements should be scalars")
    else:
        y0 = []

    // Random function evaluations.
    X_rand = space.rvs(n_samples=n_random_starts, random_state=rng)
    Xi = x0 + X_rand
    yi = y0

    for i, x in enumerate(X_rand):
        if verbose:
            func_call_no += 1
            print("Function evaluation no: %d at a "
                  "random point started" % func_call_no)
            t = time()

        curr_y = func(x)
        yi.append(curr_y)

        if verbose:
            print("Function evaluation no: %d at a "
                  "random point ended" % func_call_no)
            print("Time taken: %0.4f" % (time() - t))
            print("Function value obtained: %0.4f" % curr_y)
            print("Current minimum: %0.4f" % np.min(yi))

        if callback is not None:
            callback(pack_optimize_result(
                x0 + X_rand[:i + 1], yi, space, rng, specs))

    if np.ndim(yi) != 1:
        raise ValueError("`func` should return a scalar")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 26

Instances


Project Name: scikit-optimize/scikit-optimize
Commit Name: 00cce06892217b891c8a85ead8c51b28d556bd64
Time: 2016-08-08
Author: manojkumarsivaraj334@gmail.com
File Name: skopt/gp_opt.py
Class Name:
Method Name: gp_minimize


Project Name: scikit-optimize/scikit-optimize
Commit Name: 00cce06892217b891c8a85ead8c51b28d556bd64
Time: 2016-08-08
Author: manojkumarsivaraj334@gmail.com
File Name: skopt/tree_opt.py
Class Name:
Method Name: _tree_minimize


Project Name: scikit-optimize/scikit-optimize
Commit Name: 00cce06892217b891c8a85ead8c51b28d556bd64
Time: 2016-08-08
Author: manojkumarsivaraj334@gmail.com
File Name: skopt/gp_opt.py
Class Name:
Method Name: gp_minimize


Project Name: scikit-optimize/scikit-optimize
Commit Name: 00cce06892217b891c8a85ead8c51b28d556bd64
Time: 2016-08-08
Author: manojkumarsivaraj334@gmail.com
File Name: skopt/dummy_opt.py
Class Name:
Method Name: dummy_minimize