Skip to content

Commit

Permalink
model sdv for skopt space
Browse files Browse the repository at this point in the history
  • Loading branch information
Deathn0t committed Mar 22, 2022
1 parent dc139cf commit 8e74ebe
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions skopt/space/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,17 @@ def rvs(self, n_samples=1, random_state=None):
# Transpose
return _transpose_list_array(columns)
else:
confs = self.model_sdv.sample(n_samples)
return confs.values
confs = self.model_sdv.sample(n_samples) # sample from SDV

columns = []
for dim in self.dimensions:
if dim.name in confs.columns:
columns.append(confs[dim.name].values.tolist())
else:
columns.append(dim.rvs(n_samples=n_samples, random_state=rng))

# Transpose
return _transpose_list_array(columns)

def set_transformer(self, transform):
"""Sets the transformer of all dimension objects to `transform`
Expand Down

0 comments on commit 8e74ebe

Please sign in to comment.