Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Warm start bug when fitting a LogisticRegression model on binary outcomes with `multi_class='multinomial'`. #10836
Bug when fitting a LogisticRegression model on binary outcomes with multi_class='multinomial' when using warm start. Note that it is similar to the issue here #9889 i.e. only using a 1D
Steps/Code to Reproduce
The predictions should be the same as the model converged the first time it was run.
The predictions are different. In fact the more times you re-run the fit the worse it gets. This is actually the only reason I was able to catch the bug. It is caused by the line here https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/linear_model/logistic.py#L678.
The fix I believe is very easy, just need to swap the previous line to
I'm happy to do this although would be interested in opinions on the test. I could do either
The pros of (1) are that its quick and easy however as mentioned previously it doesn't really get to the essence of what is causing the bug. The only reason it is failing is because the
The pros of (2) are that it would correctly test that the warm starting occurred but the cons would be I don't know how I would do it as the