Skip to content

DOC adding valid intervals for SGDClassifier class parameters - #22115

Merged
jjerphan merged 13 commits into
scikit-learn:mainfrom
reshamas:ckscalar_lin_sg
Jan 13, 2022
Merged

jjerphan merged 13 commits into
scikit-learn:mainfrom
reshamas:ckscalar_lin_sg

Conversation

@reshamas

@reshamas reshamas commented Jan 2, 2022 •

Copy link
Copy Markdown
Member

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

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

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:

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@glemaitre

Copy link
Copy Markdown
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

reshamas commented Jan 4, 2022

Copy link
Copy Markdown
Member Author

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

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!


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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@jjerphan jjerphan left a comment

Copy link
Copy Markdown
Member

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.

@jjerphan jjerphan left a comment

Copy link
Copy Markdown
Member

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