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

Can you set a random state for the sdv.tabular.ctgan.CTGAN.sample method? #515

Closed
tjhallum opened this issue Jul 13, 2021 · 1 comment
Closed
Labels
question General question about the software
Milestone

Comments

@tjhallum
Copy link

tjhallum commented Jul 13, 2021

SDV version: 0.11.0
Python version: 3.6.8
Operating System: Linux

When I use the CTGAN model's sample method, I'd like to be able to set a random state so that there's repeatability with regard to the synthetic observations generated by the model.

I'm imagining something along the lines of the random_state argument available in pandas pandas.DataFrame.sample method.

Does the capability to set a random state like this for CTGAN models currently exist? I don't see any arguments like that in the current documentation for CTGAN's sample method.

@tjhallum tjhallum added pending review question General question about the software labels Jul 13, 2021
@tjhallum
Copy link
Author

tjhallum commented Jul 21, 2021

I found a workaround provided by @csala in #299 (comment).

In most cases, you can ensure reproducibility by fixing the numpy and torch seeds, as follows:

np.random.seed(SEED_VALUE)
torch.manual_seed(SEED_VALUE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General question about the software
Projects
None yet
Development

No branches or pull requests

3 participants