You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LogisticRegression freezed when X containing large number #7486
@agramfort Perhaps when X contains a number larger than a threshold say 1e30? Not sure if a warning should be thrown... I found this bug while using the outputs of predict_log_proba as input to LogisticRegression, the appveyor test just hanged for an hour and failed. Travis-ci just reported timeout. Took me a while to identify the problem so I thought maybe this is worth reporting.
Hmmmm interesting, I can confirm that it does not break. I suppose the model is poorly defined due to such large values. I tried it with dual=True and it fails to converge. I think we should probably add a warning, when values are too large and recommend scaling (it works fine when pre-processed by StandardScaler).
raising a warning sounds fine to me. But it won't prevent the code to freeze... So I'm not sure what would be the most useful. If we are sure liblinear will freeze and won't fix the upstream bug soon, maybe raising an error would be more user friendly ?
Activity
agramfort commentedon Sep 25, 2016
yl565 commentedon Sep 27, 2016
@agramfort Perhaps when X contains a number larger than a threshold say 1e30? Not sure if a warning should be thrown... I found this bug while using the outputs of predict_log_proba as input to LogisticRegression, the appveyor test just hanged for an hour and failed. Travis-ci just reported timeout. Took me a while to identify the problem so I thought maybe this is worth reporting.
snath-xoc commentedon Jun 27, 2025
Hmmmm interesting, I can confirm that it does not break. I suppose the model is poorly defined due to such large values. I tried it with
dual=Trueand it fails to converge. I think we should probably add a warning, when values are too large and recommend scaling (it works fine when pre-processed byStandardScaler).@antoinebaker any thoughts?
antoinebaker commentedon Jun 27, 2025
raising a warning sounds fine to me. But it won't prevent the code to freeze... So I'm not sure what would be the most useful. If we are sure liblinear will freeze and won't fix the upstream bug soon, maybe raising an error would be more user friendly ?
snath-xoc commentedon Jul 4, 2025
I agree an error may be better, if no one objects I can start a small PR?