Skip to content

Conversation

@WeichenXu123
Copy link
Contributor

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.

@SparkQA
Copy link

SparkQA commented Jul 10, 2016

Test build #62044 has finished for PR 14122 at commit 2cb9d81.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

}

if (!state.actuallyConverged) {
logWarning("LinearRegression training fininshed but the result is not converged, " +
Copy link
Member

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: ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srowen Done. thanks~

@SparkQA
Copy link

SparkQA commented Jul 10, 2016

Test build #62055 has finished for PR 14122 at commit 36dadb2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

asfgit pushed a commit that referenced this pull request Jul 12, 2016
… 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>
@srowen
Copy link
Member

srowen commented Jul 12, 2016

Merged to master, and 2.0 on the grounds that it's just an added informative warning

@asfgit asfgit closed this in 6cb75db Jul 12, 2016
@WeichenXu123 WeichenXu123 deleted the add_lr_not_convergence_warn branch July 12, 2016 15:08
}

if (!state.actuallyConverged) {
logWarning("LinearRegression training fininshed but the result " +
Copy link
Contributor

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 :(

Copy link
Contributor Author

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

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.

4 participants