-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
kmeans_inducing_points
is non-reproducibly random
#4712
Comments
CC @bwengals |
Thanks @JohnGoertz, want to do a PR that fixes this? |
I think we should not go with this proposal. |
Oh, wouldn't you know it, a PR fixing this exact problem was merged into scipy just a few weeks ago: scipy/scipy#13972 Guess we just gotta wait for 1.7.0 to be released. |
Amazing, then we only have to expose the |
Fixed by #5055. One can now pass in arbitrary kwargs to |
Calling
kmeans_inducing_points
from gp.utils results in different values every time, with no way to specify a random seed.It appears that function wraps Scipy's kmeans, which takes its random seed from
np.random.seed()
, so it should be a quick fix to add arandom_seed
kwarg that just gets passed tonp.random.seed()
before calling scipy. I'm not sure if that would have broader unintended consequences, such as if the user had subsequent calls tonp.random
. However, if the user is calling kmeans with a specified random seed, they likely want their whole workflow to be reproducibly random, so maybe it wouldn't be an issue? Additionally, new code should use the more recent numpy random Generator, whichnp.random.seed()
shouldn't affect.The text was updated successfully, but these errors were encountered: