Repository: spark
Updated Branches:
  refs/heads/master 1aa9e5025 -> 0c498717b


[SPARK-10715] [ML] Duplicate initialization flag in WeightedLeastSquare

There are duplicate set of initialization flag in `WeightedLeastSquares#add`.
`initialized` is already set in `init(Int)`.

Author: lewuathe <[email protected]>

Closes #8837 from Lewuathe/duplicate-initialization-flag.


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

Branch: refs/heads/master
Commit: 0c498717ba9622b6c889e701e8eed5ef9215c030
Parents: 1aa9e50
Author: lewuathe <[email protected]>
Authored: Sun Sep 20 16:16:31 2015 -0700
Committer: Xiangrui Meng <[email protected]>
Committed: Sun Sep 20 16:16:31 2015 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/0c498717/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
----------------------------------------------------------------------
diff --git 
a/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala 
b/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
index 0ff8931..4374e99 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
@@ -193,7 +193,6 @@ private[ml] object WeightedLeastSquares {
       val ak = a.size
       if (!initialized) {
         init(ak)
-        initialized = true
       }
       assert(ak == k, s"Dimension mismatch. Expect vectors of size $k but got 
$ak.")
       count += 1L


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

Reply via email to