Skip to content

MNT replace Cython loss functions in SGD part 1 #27999

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

Conversation

lorentzenchr
Copy link
Member

Reference Issues/PRs

Towards #15123.

What does this implement/fix? Explain your changes.

This PR merely changes the order of Cython arguments to align with the ones in the sklearn._loss module.

Any other comments?

Note that SGDClassifier and SGDOneClassSVM have an attribute loss_function_ that exposes the Cython extension type. Those attributes are depcrecated as of 1.4, see #27979.
This PR does not change the Python API of those loss_function_, only the Cython arguments which I would argue, are not part of the Python API.

Copy link

github-actions bot commented Dec 21, 2023

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: e6103db. Link to the linter CI: here

@lorentzenchr lorentzenchr force-pushed the replace_sgd_with_common_loss_part_1 branch from e65ed41 to df4bdca Compare December 21, 2023 18:27
@lorentzenchr lorentzenchr added this to the 1.5 milestone Dec 27, 2023
@thomasjpfan
Copy link
Member

Can you write a high level summary of your three PRs in an issue? I'm guessing you are waiting for loss_function_ to be removed in 1.6 before switching the loss function over.

Technically, we can make the switch over to the _loss module now and leave the LossFunction code unused besides setting loss_function_. Then in 1.6, we'll remove all the LossFunction code.

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.

Thank you, @lorentzenchr.

Copy link
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @lorentzenchr

@OmarManzoor OmarManzoor merged commit fd814a0 into scikit-learn:main Jan 18, 2024
@lorentzenchr lorentzenchr deleted the replace_sgd_with_common_loss_part_1 branch January 18, 2024 22:00
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Feb 10, 2024
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.

4 participants