Skip to content

DOC Fix doc of defaults in grower.py #18206

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

Merged
merged 8 commits into from
Aug 26, 2020

Conversation

franslarsson
Copy link
Contributor

@franslarsson franslarsson commented Aug 19, 2020

Reference Issues/PRs

See #15761

What does this implement/fix? Explain your changes.

This PR change how default values are documented in sklearn.ensemble._hist_gradient_boosting.grower.py and update docstring according to guideline.

Any other comments?

Added missing parameter monotonic_cst in docstring for TreeGrower.

Copy link
Member

@alfaro96 alfaro96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @franslarsson for the PR!

I have just a few suggestions.

@@ -508,7 +513,7 @@ def make_predictor(self, bin_thresholds=None):

Parameters
----------
bin_thresholds : array-like of floats, optional (default=None)
bin_thresholds : array-like of floats, default=None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bin_thresholds : array-like of floats, default=None
bin_thresholds : array-like, dtype=float, default=None

franslarsson and others added 3 commits August 20, 2020 20:39
Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es>
Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es>
Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es>
@franslarsson
Copy link
Contributor Author

Thank you @franslarsson for the PR!

I have just a few suggestions.

Thanks for the review @alfaro96 . I have committed the changes for unsigned int and bool. However, regarding the dtype for float and int I am a bit unsure if we should use the valid numpy dtypes instead, e.g. np.float64, np.float32, np.int64 as suggested in the comments in #18025 . And if so would that be the case for array-like as well?

@glemaitre
Copy link
Member

NumPy dtype will apply only to ndarray. Array-like can be a Python list with int Python type which will be converted to np.int64 if we do a check_array. So when array-like it makes sense to use valid Python dtype.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franslarsson Could you make the 2 changes. Otherwise LGTM

franslarsson and others added 2 commits August 25, 2020 21:44
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
@franslarsson
Copy link
Contributor Author

@franslarsson Could you make the 2 changes. Otherwise LGTM

I have now made the changes. Thanks for the review @glemaitre and @alfaro96 .

@glemaitre glemaitre merged commit e126a85 into scikit-learn:master Aug 26, 2020
@glemaitre
Copy link
Member

Thanks @franslarsson

@franslarsson franslarsson deleted the doc_grower branch August 26, 2020 17:53
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
…18206)

Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants