-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] Changed self.rng to private (self.rng_) in sklearn/gaussian_process/g… #7766
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
Conversation
Is there a reason to have it as an attribute at all? |
I changed my mind. If it's not necessary, we should not set it. |
hm do we need a deprecation, though? hm |
Not if this fixed in 0.18.1 right? |
@amueller It may be required as an attribute in case it's required to reproduce a certain result. |
@@ -161,7 +161,7 @@ def fit(self, X, y): | |||
else: | |||
self.kernel_ = clone(self.kernel) | |||
|
|||
self.rng = check_random_state(self.random_state) | |||
self.rng_ = check_random_state(self.random_state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tayyabpw You need to add 'rng_' in the 'Attributes' section in the docstring above.
Will change in the next 3 hours. Thanks |
Added Attribute to docstring. There was another self.rng in fit() function that I had missed out. Fixed that. Please review. |
@@ -128,6 +128,8 @@ def optimizer(obj_func, initial_theta, bounds): | |||
log_marginal_likelihood_value_ : float | |||
The log-marginal-likelihood of ``self.kernel_.theta`` | |||
|
|||
rng_ : numpy.RandomState | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to explain what this attribute is. Look at the above declarations. The user needs to know what this stands for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe like this:
rng_ : numpy.RandomState
random_state used at the time of initialization
@amueller Please give your views in this regard. Would you prefer keeping it as an attribute or better have it removed? |
I think we should remove it, but we need to deprecate it. |
Give @tayyabpw a couple of days, there's not real urgency here. There's plenty of issues to go around ;) |
@dalmia sure, go ahead |
@ogrisel, This has been solved by #7846. So this PR can be closed. |
Thanks for checking @AssiaBen ! |
Reference Issue
Fixes #7752
What does this implement/fix? Explain your changes.
Changes self.rng to private (self.rng_) as stated in the issues page
Any other comments?
…pr.py