Skip to content

MNT carry out 1.10 deprecation of negative power_t in SGD estimators - #35279

Merged
lesteve merged 3 commits into
scikit-learn:mainfrom
dcrew44:mnt-sgd-power-t-1.10-deprecation
Nov 3, 2026
Merged

lesteve merged 3 commits into
scikit-learn:mainfrom
dcrew44:mnt-sgd-power-t-1.10-deprecation

Conversation

@dcrew44

@dcrew44 dcrew44 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Towards #35252

What does this implement/fix? Explain your changes.

Carries out the 1.10 deprecation of negative power_t in SGD estimators.

  • Set the power_t constraint to [0, inf) in SGDClassifier, SGDRegressor, and SGDOneClassSVM, so negative values now raise InvalidParameterError.
  • Removed FutureWarning and the .. deprecated:: 1.8 docstring notes.
  • Removed test_power_t_limits; the common parameter validation checks now cover this.
  • Removed now unused warnings import from test_sgd.py.

Introduce yourself

Hi, I'm Hayden I have a BS in Math and Computer Science and I'm interested in machine learning. I'm new to open source, and this is one of my first PRs so any advice is much appreciated. I'm excited to begin contributing.

AI usage disclosure

I used AI assistance for:

  • Research and understanding
  • Editing the PR description

Any other comments?

The removed warning was only raised in fit, so partial_fit users with a negative power_t get the error without a prior warning. No changelog entry, since #31474 already announced this change.

@github-actions

Copy link
Copy Markdown

Thank you for opening your first pull request to scikit-learn! 🎉

To help get your contribution reviewed, please make sure that:

  • You have filled out the pull request template.

  • The pull request addresses an existing issue that is ready for contribution (e.g. not tagged as 'Needs Triage', 'Needs Decision', ...). If you are proposing a new feature, please open an issue to discuss it first.

  • There are no other open pull requests already targeting the same issue.

  • You have followed the pull request checklist. In particular, linting and tests should pass.

@lesteve lesteve 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, thanks!

I don't think we need a changelog for this. IIRC, we add a changelog for the deprecation and none for the removal.

@AnneBeyer AnneBeyer 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 @dcrew44, LGTM.
@lesteve please merge it. :)

@lesteve
lesteve merged commit 4ef4e9a into scikit-learn:main Nov 3, 2026
38 checks passed
@lesteve

lesteve commented Nov 3, 2026

Copy link
Copy Markdown
Member

Merged, thanks @dcrew44 and @AnneBeyer!

@lesteve

lesteve commented Nov 3, 2026

Copy link
Copy Markdown
Member

@dcrew44 please have a look at our automated contribution policy.

In particular there is no need to merge main into your branch unless there are conflicts to resolve. It kind of feels like some automation of some sort, but I may be overguessing on this one 😅.

@AnneBeyer

Copy link
Copy Markdown
Member

In @dcrew44's defense, I also didn't know that until someone (maybe you, @lesteve ;) ) told me that explicitly, so we could make it more prominent in the docs at some point (it currently only says: "It is often helpful to keep your local feature branch synchronized with the latest changes of the main scikit-learn repository").

@dcrew44

dcrew44 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@lesteve thanks for the heads up lol. That was my first pr, should have read the policy in more detail lol.

@lesteve

lesteve commented Nov 6, 2026

Copy link
Copy Markdown
Member

it currently only says: "It is often helpful to keep your local feature branch synchronized with the latest changes of the main scikit-learn repository"

Yeah, I don't really see a good reason for this but doing some git archaeology may offer interesting insights 🤷.

@lesteve

lesteve commented Nov 6, 2026

Copy link
Copy Markdown
Member

There you go @dcrew44, don't read it all at once 😉!

Please have a look at our contributing doc and in particular the section Issues for new contributors.

There is also GitHub's How to contribute to Open-Source guide, which gives a good generic overview about how open-source works.

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