[GitHub] spark pull request #14122: [SPARK-16470][ML][Optimizer] Check linear regress...

2016-07-17 Thread WeichenXu123
Github user WeichenXu123 commented on a diff in the pull request:

https://github.com/apache/spark/pull/14122#discussion_r71083700
  
--- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
@@ -327,6 +327,11 @@ class LinearRegression @Since("1.3.0") 
(@Since("1.3.0") override val uid: String
 throw new SparkException(msg)
   }
 
+  if (!state.actuallyConverged) {
+logWarning("LinearRegression training fininshed but the result " +
--- End diff --

Oh, I'm sorry, I fixed that in #14238 , thanks! @jaceklaskowski @srowen 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14122: [SPARK-16470][ML][Optimizer] Check linear regress...

2016-07-17 Thread jaceklaskowski
Github user jaceklaskowski commented on a diff in the pull request:

https://github.com/apache/spark/pull/14122#discussion_r71083220
  
--- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
@@ -327,6 +327,11 @@ class LinearRegression @Since("1.3.0") 
(@Since("1.3.0") override val uid: String
 throw new SparkException(msg)
   }
 
+  if (!state.actuallyConverged) {
+logWarning("LinearRegression training fininshed but the result " +
--- End diff --

@srowen There's a typo in `fininshed` :(


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14122: [SPARK-16470][ML][Optimizer] Check linear regress...

2016-07-12 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/14122


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14122: [SPARK-16470][ML][Optimizer] Check linear regress...

2016-07-10 Thread WeichenXu123
Github user WeichenXu123 commented on a diff in the pull request:

https://github.com/apache/spark/pull/14122#discussion_r70181416
  
--- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
@@ -327,6 +327,11 @@ class LinearRegression @Since("1.3.0") 
(@Since("1.3.0") override val uid: String
 throw new SparkException(msg)
   }
 
+  if (!state.actuallyConverged) {
+logWarning("LinearRegression training fininshed but the result is 
not converged, " +
--- End diff --

@srowen Done. thanks~


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14122: [SPARK-16470][ML][Optimizer] Check linear regress...

2016-07-10 Thread srowen
Github user srowen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14122#discussion_r70180443
  
--- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
@@ -327,6 +327,11 @@ class LinearRegression @Since("1.3.0") 
(@Since("1.3.0") override val uid: String
 throw new SparkException(msg)
   }
 
+  if (!state.actuallyConverged) {
+logWarning("LinearRegression training fininshed but the result is 
not converged, " +
--- End diff --

LGTM though you could use string interpolation here.  Maybe slightly better 
as "Linear regression training fininshed but the result is not converged 
because: ..."


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14122: [SPARK-16470][ML][Optimizer] Check linear regress...

2016-07-09 Thread WeichenXu123
GitHub user WeichenXu123 opened a pull request:

https://github.com/apache/spark/pull/14122

[SPARK-16470][ML][Optimizer] Check linear regression training whether 
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.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/WeichenXu123/spark add_lr_not_convergence_warn

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/14122.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #14122


commit 2cb9d814fded6b6bafa0a046a30060455069ddc6
Author: WeichenXu 
Date:   2016-07-10T06:07:13Z

add linear regression training not convergence warning




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org