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

Ensure same results with ModelBuilder.fit random_seed #961

Closed
wd60622 opened this issue Aug 22, 2024 · 0 comments · Fixed by #963
Closed

Ensure same results with ModelBuilder.fit random_seed #961

wd60622 opened this issue Aug 22, 2024 · 0 comments · Fixed by #963
Labels
bug Something isn't working ModelBuilder Related to the ModelBuilder class and its children

Comments

@wd60622
Copy link
Contributor

wd60622 commented Aug 22, 2024

Brought up in #958, there are different results depending on the way on the random_seed is set.

# Doesn't work
model.fit(random_seed=42)
model.fit(..., random_seed=np.random.default_rng(42))
# Does work
model = ModelBuilder(..., sampler_config={"random_seed": 42})
model.fit(...)
# Doesn't work because of np.random.Generator is not serializable
model = ModelBuilder(..., sampler_config={"random_seed": np.random.default_rng(42)})
model.fit(...)

Current workaround: Use an int random_seed parameter in sampler_config at initialization.

See the #958 for more details.

@wd60622 wd60622 mentioned this issue Aug 22, 2024
13 tasks
@wd60622 wd60622 linked a pull request Aug 22, 2024 that will close this issue
13 tasks
@wd60622 wd60622 added ModelBuilder Related to the ModelBuilder class and its children bug Something isn't working labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ModelBuilder Related to the ModelBuilder class and its children
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant