f2cfa5fb8e73229a1757acbcc94bab13099de439,PyPi/utils/spaces.py,MultiDiscrete,get_idx,#MultiDiscrete#Any#,84
Before Change
def get_idx(self, value):
idx = list()
for s, v in enumerate(value):
idx.append(np.argwhere(
self.discrete_spaces[s].values == v).ravel()[0])
return idx
After Change
return np.array(values)
def get_idx(self, value):
if value.ndim == 1:
idxs = [
self.discrete_spaces[i]._idxs[v] for i, v in enumerate(value)]
elif value.ndim == 2:
idxs = list()
for v in value:
idx = [
self.discrete_spaces[i]._idxs[v1] for i, v1 in enumerate(v)]
idxs.append(idx)
else:
raise ValueError("Wrong dimension for indices array.")
return np.array(idxs)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: AIRLab-POLIMI/mushroom
Commit Name: f2cfa5fb8e73229a1757acbcc94bab13099de439
Time: 2017-06-05
Author: carlo.deramo@gmail.com
File Name: PyPi/utils/spaces.py
Class Name: MultiDiscrete
Method Name: get_idx
Project Name: scikit-optimize/scikit-optimize
Commit Name: 4af750bec058da0cf5d4a3245a443549b9d7fd33
Time: 2016-04-05
Author: manojkumarsivaraj334@gmail.com
File Name: skopt/gp_opt.py
Class Name:
Method Name: acquisition
Project Name: AIRLab-POLIMI/mushroom
Commit Name: f2cfa5fb8e73229a1757acbcc94bab13099de439
Time: 2017-06-05
Author: carlo.deramo@gmail.com
File Name: PyPi/utils/spaces.py
Class Name: Discrete
Method Name: get_idx