-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-16470][ML][Optimizer] Check linear regression training whether actually reach convergence and add warning if not #14122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #62044 has finished for PR 14122 at commit
|
| } | ||
|
|
||
| if (!state.actuallyConverged) { | ||
| logWarning("LinearRegression training fininshed but the result is not converged, " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM though you could use string interpolation here. Maybe slightly better as "Linear regression training fininshed but the result is not converged because: ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen Done. thanks~
|
Test build #62055 has finished for PR 14122 at commit
|
… actually reach convergence and add warning if not ## What changes were proposed in this pull request? In `ml.regression.LinearRegression`, it use breeze `LBFGS` and `OWLQN` optimizer to do data training, but do not check whether breeze's optimizer returned result actually reached convergence. The `LBFGS` and `OWLQN` optimizer in breeze finish iteration may result the following situations: 1) reach max iteration number 2) function reach value convergence 3) objective function stop improving 4) gradient reach convergence 5) search failed(due to some internal numerical error) I add warning printing code so that if the iteration result is (1) or (3) or (5) in above, it will print a warning with respective reason string. ## How was this patch tested? Manual. Author: WeichenXu <WeichenXu123@outlook.com> Closes #14122 from WeichenXu123/add_lr_not_convergence_warn. (cherry picked from commit 6cb75db) Signed-off-by: Sean Owen <sowen@cloudera.com>
|
Merged to master, and 2.0 on the grounds that it's just an added informative warning |
| } | ||
|
|
||
| if (!state.actuallyConverged) { | ||
| logWarning("LinearRegression training fininshed but the result " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen There's a typo in fininshed :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm sorry, I fixed that in #14238 , thanks! @jaceklaskowski @srowen
What changes were proposed in this pull request?
In
ml.regression.LinearRegression, it use breezeLBFGSandOWLQNoptimizer to do data training, but do not check whether breeze's optimizer returned result actually reached convergence.The
LBFGSandOWLQNoptimizer in breeze finish iteration may result the following situations:I add warning printing code so that
if the iteration result is (1) or (3) or (5) in above, it will print a warning with respective reason string.
How was this patch tested?
Manual.