544875dd8a7fea49a86e5623d37274159b4ba7b5,skopt/optimizer/base.py,,base_minimize,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,20
Before Change
// User suggested points at which to evaluate the objective first
if x0 and y0 is None:
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:
result = create_result(optimizer.Xi, optimizer.yi,
optimizer.space, optimizer.rng,
specs, optimizer.models)
for c in callbacks:
c(result)
// User is god and knows the value of the objective at these points
elif x0 and y0 is not None:
if not (isinstance(y0, Iterable) or isinstance(y0, numbers.Number)):
raise ValueError(
"`y0` should be an iterable or a scalar, got %s" % type(y0))
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)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: scikit-optimize/scikit-optimize
Commit Name: 544875dd8a7fea49a86e5623d37274159b4ba7b5
Time: 2017-01-10
Author: betatim@gmail.com
File Name: skopt/optimizer/base.py
Class Name:
Method Name: base_minimize
Project Name: AlexEMG/DeepLabCut
Commit Name: ef59c0f5b64e5a3e76790855795a6393c5858963
Time: 2020-05-27
Author: 30733203+jeylau@users.noreply.github.com
File Name: deeplabcut/generate_training_dataset/multiple_individuals_labeling_toolbox.py
Class Name: MainFrame
Method Name: browseDir
Project Name: pandas-dev/pandas
Commit Name: 3d281cf1a37f9b982df130c2ce9706cfc66a88aa
Time: 2021-02-17
Author: rhshadrach@gmail.com
File Name: pandas/core/apply.py
Class Name: Apply
Method Name: agg_list_like