Skip to content

Conversation

@TomDLT
Copy link
Member

@TomDLT TomDLT commented Jun 14, 2022

Fixes #23605 (bug introduced in #21808)

LogisticRegression fails if all the following conditions are met:

  • n_features = 1
  • solver = "newton-cg"
  • fit_intercept = True

Potential candidate bugfix for release 1.1.2, to fix downstream raphaelvallat/pingouin#272.

@TomDLT TomDLT added this to the 1.1.2 milestone Jun 14, 2022
@glemaitre glemaitre self-requested a review June 14, 2022 16:09
Copy link
Member

@lorentzenchr lorentzenchr left a comment

Choose a reason for hiding this comment

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

LGTM. @TomDLT Thanks for fixing my bugs 👍

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, thanks @TomDLT.

@lorentzenchr lorentzenchr added the Quick Review For PRs that are quick to review label Jun 15, 2022
@lorentzenchr lorentzenchr changed the title Fix logistic regression with newton_cg solver, a single feature, and an intercept FIX logistic regression with newton_cg solver, a single feature, and an intercept Jun 15, 2022
@lorentzenchr lorentzenchr merged commit 59473a9 into scikit-learn:main Jun 15, 2022
@TomDLT TomDLT deleted the newtoncg_monofeature branch June 15, 2022 18:29
ogrisel pushed a commit to ogrisel/scikit-learn that referenced this pull request Jul 11, 2022
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Aug 4, 2022
glemaitre pushed a commit that referenced this pull request Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:linear_model Quick Review For PRs that are quick to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LogisticRegression fails in sklearn 1.1.1 with newton-cg solver when X only contains one predictor

3 participants