Repository: spark
Updated Branches:
  refs/heads/branch-2.0 689261465 -> 9e0d2e226


[MINOR][ML] update comment where is inconsistent with code in 
ml.regression.LinearRegression

## What changes were proposed in this pull request?

In `train` method of `ml.regression.LinearRegression` when handling situation 
`std(label) == 0`
the code replace `std(label)` with `mean(label)` but the relative comment is 
inconsistent, I update it.

## How was this patch tested?

N/A

Author: WeichenXu <[email protected]>

Closes #14121 from WeichenXu123/update_lr_comment.

(cherry picked from commit fc11c509e234c5414687f7fbd13af113a1f52f10)
Signed-off-by: Sean Owen <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9e0d2e22
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9e0d2e22
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9e0d2e22

Branch: refs/heads/branch-2.0
Commit: 9e0d2e22637f6cef2ab91aadcdeb8f06f677e397
Parents: 6892614
Author: WeichenXu <[email protected]>
Authored: Tue Jul 12 09:23:59 2016 +0100
Committer: Sean Owen <[email protected]>
Committed: Tue Jul 12 09:24:09 2016 +0100

----------------------------------------------------------------------
 .../scala/org/apache/spark/ml/regression/LinearRegression.scala    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/9e0d2e22/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
----------------------------------------------------------------------
diff --git 
a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala 
b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
index 0a4d98c..0477f71 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala
@@ -263,7 +263,7 @@ class LinearRegression @Since("1.3.0") (@Since("1.3.0") 
override val uid: String
     }
 
     // if y is constant (rawYStd is zero), then y cannot be scaled. In this 
case
-    // setting yStd=1.0 ensures that y is not scaled anymore in l-bfgs 
algorithm.
+    // setting yStd=abs(yMean) ensures that y is not scaled anymore in l-bfgs 
algorithm.
     val yStd = if (rawYStd > 0) rawYStd else math.abs(yMean)
     val featuresMean = featuresSummarizer.mean.toArray
     val featuresStd = featuresSummarizer.variance.toArray.map(math.sqrt)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to