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

Skip to content

Conversation

@lorentzenchr
Copy link
Member

Reference Issues/PRs

Aftermath of #32014.

What does this implement/fix? Explain your changes.

This fixes a tiny code bug. I think it does (almost never) influence fitting an estimator.

Any other comments?

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

✔️ Linting Passed

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

Generated for commit: 0efe599. Link to the linter CI: here

@lorentzenchr lorentzenchr force-pushed the fix_gap_safe_screening branch from 5b840eb to 8662cb3 Compare November 28, 2025 14:41
@lorentzenchr
Copy link
Member Author

@lesteve @jeremiedbb For a potential 1.8.1. release.

@jeremiedbb jeremiedbb added this to the 1.8 milestone Nov 28, 2025
@jeremiedbb
Copy link
Member

Actually we're still between RC and final so we can include bug fixes for the final release. I put it in the 1.8 milestone

Copy link
Member

@virchan virchan 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!

@virchan virchan added the Waiting for Second Reviewer First reviewer is done, need a second one! label Nov 29, 2025
@lesteve
Copy link
Member

lesteve commented Dec 1, 2025

Aftermath of #32014.

It feels like this change will probably end up in the 1.8 release, and it doesn't deserve a changelog entry since #32014 is new in 1.8.

If there is a way to have a non-regression test, that would also be nice.

@lorentzenchr
Copy link
Member Author

If there is a way to have a non-regression test

Not really. The algo was correct before this fix (-> all tests did pass). It is now more efficient (and the tests still pass).
In almost all cases, the resulting coefficients are the same with and without this PR (I don’t find a case where it would differ).

@ogrisel ogrisel self-requested a review December 2, 2025 09:42
@ogrisel
Copy link
Member

ogrisel commented Dec 2, 2025

FYI, I am reviewing this PR at the moment.

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.

I tried to evaluate the impact of this change, but despite some effort I could never write code that would reach the branch in line 1447, hence this change has probably no effect. I also checked that our existing tests do not cover that branch (note that we do not collect Cython code coverage data, so this lack of coverage is not easy to spot).

The matching code in enet_coordinate_descent is the branch at line 379. This branch is covered by our tests (namely test_sparse_dense_equality) but only with non-unit sample_weight values. As the MultiTask{Lasso,ElasticNet} classes do not accept sample weights, I could not find an easy way to adapt this test case of enet_coordinate_descent to increase that branch of enet_coordinate_descent_multi_task.

So to conclude, this change has no user impact but makes the code a bit more consistent. We probably have dead code in enet_coordinate_descent_multi_task but we could address this concern later.

@ogrisel ogrisel merged commit ee50be6 into scikit-learn:main Dec 2, 2025
37 checks passed
@ogrisel ogrisel deleted the fix_gap_safe_screening branch December 2, 2025 13:52
@lesteve
Copy link
Member

lesteve commented Dec 2, 2025

Thanks a lot @ogrisel for the review and merge!

lesteve added a commit to lesteve/scikit-learn that referenced this pull request Dec 9, 2025
@lesteve lesteve mentioned this pull request Dec 9, 2025
14 tasks
lesteve added a commit to lesteve/scikit-learn that referenced this pull request Dec 9, 2025
lesteve added a commit that referenced this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cython module:linear_model Waiting for Second Reviewer First reviewer is done, need a second one!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants