Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC adding valid intervals for SGDClassifier class parameters #22115

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 13 commits into from
Jan 13, 2022

Conversation

reshamas
Copy link
Member

@reshamas reshamas commented Jan 2, 2022

Reference Issues/PRs

References #21927

What does this implement/fix? Explain your changes.

Add possible interval ranges for various parameters in class SGDClassifier

Any other comments?

#DataUmbrella #postsprint

Reference

SGDClassifier documentation

@reshamas reshamas changed the title DOC adding valid intervals for SGDClassifier class parameters WIP DOC adding valid intervals for SGDClassifier class parameters Jan 2, 2022
Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Please find my comments below:

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM!

@glemaitre
Copy link
Member

Since the PR is tagged as WIP, @reshamas did you have any other changes in mind or we can merge this PR as-is?

@reshamas
Copy link
Member Author

reshamas commented Jan 4, 2022

Since the PR is tagged as WIP, @reshamas did you have any other changes in mind or we can merge this PR as-is?

Looks like I ought to probably add ranges for these numerical parameters, right?

  • power_t
  • validation_fraction
  • n_iter_no_change

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -1037,10 +1037,11 @@ class SGDClassifier(BaseSGDClassifier):

power_t : float, default=0.5
The exponent for inverse scaling learning rate [default 0.5].
Values should be in the range `(-inf, inf)`.
Copy link
Member

Choose a reason for hiding this comment

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

I do not anticipate negative power_t to be mathematically meaningful but apparently our code accepts it without crashing... So ok with documenting it.

Copy link
Member

Choose a reason for hiding this comment

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

I feel like this a case where documenting -inf will lead to more people trying out. If this is not mathematically meaningful, then we could be promoting a bad practice?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tested the code in the Binder notebook.
We can open up an issue to address this. Or, is this something that can be set up with tests in the next step, which will be adding check_scalar functions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened issue #22178

@reshamas reshamas changed the title WIP DOC adding valid intervals for SGDClassifier class parameters DOC adding valid intervals for SGDClassifier class parameters Jan 7, 2022
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.

Otherwise LGTM. We can look at the problem of negative power_t in a dedicate issue.

@reshamas
Copy link
Member Author

Reminder to self:
use text "must be" instead of "should be" for range interval

Copy link
Member

@jjerphan jjerphan 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 for the PRs, @reshamas.

I think, it is more appropriate to use must over should here.

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

LGTM!

@jjerphan jjerphan merged commit 8d62171 into scikit-learn:main Jan 13, 2022
@reshamas reshamas deleted the ckscalar_lin_sg branch January 14, 2022 13:18
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.

5 participants