Skip to content

Fix linear selection on Python 3.12 - #25

Closed
russlan23 wants to merge 1 commit into
fidelity:masterfrom
russlan23:fix/python-312-linear-selection
Closed

russlan23 wants to merge 1 commit into
fidelity:masterfrom
russlan23:fix/python-312-linear-selection

Conversation

@russlan23

Copy link
Copy Markdown

Fixes #24.

scikit-learn removed the multi_class parameter from LogisticRegression. This keeps the existing liblinear one-vs-rest behavior by wrapping the two logistic estimators in OneVsRestClassifier, then preserves the existing coefficient aggregation when computing feature scores.

Validation:

  • Python 3.12.6 / scikit-learn 1.9.0: none, lasso, and ridge classification paths fit and transform successfully on Iris
  • Python 3.11.10 / scikit-learn 1.5.2: the new unregularized scores match the legacy implementation exactly
  • Python compile check and git diff check pass

@russlan23
russlan23 requested a review from skadio as a code owner August 26, 2026 16:36
@skadio
skadio requested review from rbaral and takojunior August 26, 2026 16:55
@skadio

skadio commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

@russlan23 thank you so much for this PR and the fix. Coincidently, we were also just in the middle of updating this specific issue. Please stay tuned for an update shortly. We might use this PR (or, close this one and make an version upgrade internally). Either way, this is going to be fixed very soon. cc: @rbaral @takojunior

@rbaral

rbaral commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@russlan23 thanks for the suggestion you provided. This and with some other minimal fix in text_based.py (for upgraded pandas due to Python 3.12), I was able to run the test cases for Python 3.12. and Python 3.10. I can bundle these two fixes and some housekeeping work into a new PR. We also need to add some documentation about the fix.

It would have been better to have minimal code changes, such as using a different solver. However, that required some changes in the test cases. CC @skadio @takojunior

@rbaral

rbaral commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@russlan23 The fix has already been addressed in another PR (#26). It will be pushed to pypi shortly. I will close this PR and the related issue. Thanks for your awareness and I hope you continue using selective library.

@rbaral rbaral closed this Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linear Selection Method fails with Python 3.12

3 participants