Skip to content

MNT replace Cython loss functions in SGD part 1 - #27999

Merged
OmarManzoor merged 4 commits into
scikit-learn:mainfrom
lorentzenchr:replace_sgd_with_common_loss_part_1
Jan 18, 2024
Merged

OmarManzoor merged 4 commits into
scikit-learn:mainfrom
lorentzenchr:replace_sgd_with_common_loss_part_1

Conversation

@lorentzenchr

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

@github-actions

github-actions Bot commented Dec 21, 2023 •

Copy link
Copy Markdown

✔️ 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
Copy Markdown
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.

Comment thread sklearn/linear_model/_sgd_fast.pxd Resolved

@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.

Thank you, @lorentzenchr.

@OmarManzoor OmarManzoor left a comment

Copy link
Copy Markdown
Contributor

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