spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject spark git commit: [SPARK-8140] [MLLIB] Remove construct to get weights in StreamingLinearAlgorithm
Date Tue, 09 Jun 2015 14:00:40 GMT
Repository: spark
Updated Branches:
  refs/heads/master e6fb6cedf -> 6c1723abe


[SPARK-8140] [MLLIB] Remove construct to get weights in StreamingLinearAlgorithm

Author: MechCoder <manojkumarsivaraj334@gmail.com>

Closes #6720 from MechCoder/empty_model_check and squashes the following commits:

3a07de5 [MechCoder] Remove construct to get weights in StreamingLinearAlgorithm


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

Branch: refs/heads/master
Commit: 6c1723abeb4e0580efec05a655343f46521fc265
Parents: e6fb6ce
Author: MechCoder <manojkumarsivaraj334@gmail.com>
Authored: Tue Jun 9 15:00:35 2015 +0100
Committer: Sean Owen <sowen@cloudera.com>
Committed: Tue Jun 9 15:00:35 2015 +0100

----------------------------------------------------------------------
 .../spark/mllib/regression/StreamingLinearAlgorithm.scala     | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6c1723ab/mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala
b/mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala
index 39308e5..aee51bf 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala
@@ -83,12 +83,7 @@ abstract class StreamingLinearAlgorithm[
       throw new IllegalArgumentException("Model must be initialized before starting training.")
     }
     data.foreachRDD { (rdd, time) =>
-      val initialWeights =
-        model match {
-          case Some(m) =>
-            m.weights
-        }
-      model = Some(algorithm.run(rdd, initialWeights))
+      model = Some(algorithm.run(rdd, model.get.weights))
       logInfo("Model updated at time %s".format(time.toString))
       val display = model.get.weights.size match {
         case x if x > 100 => model.get.weights.toArray.take(100).mkString("[", ",",
"...")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message