Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate 'n_samples' number of data points #290

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdgym/synthesizers/independent.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def _sample_from_synthesizer(self, synthesizer, n_samples):
for name, column in transformed.items():
kind = column.dtype.kind
if kind == 'O':
values = column.sample(self.length, replace=True).to_numpy()
values = column.sample(n_samples, replace=True).to_numpy()
else:
model = gm_models.get(name)
values = model.sample(self.length)[0].ravel().clip(column.min(), column.max())
values = model.sample(n_samples)[0].ravel().clip(column.min(), column.max())

sampled[name] = values

Expand Down
4 changes: 2 additions & 2 deletions sdgym/synthesizers/uniform.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def _sample_from_synthesizer(self, synthesizer, n_samples):
for name, column in transformed.items():
kind = column.dtype.kind
if kind == 'i':
values = np.random.randint(column.min(), column.max() + 1, size=self.length)
values = np.random.randint(column.min(), column.max() + 1, size=n_samples)
elif kind in ['O', 'b']:
values = np.random.choice(column.unique(), size=self.length)
else:
values = np.random.uniform(column.min(), column.max(), size=self.length)
values = np.random.uniform(column.min(), column.max(), size=n_samples)

sampled[name] = values

Expand Down