aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMechCoder <manojkumarsivaraj334@gmail.com>2015-06-09 15:00:35 +0100
committerSean Owen <sowen@cloudera.com>2015-06-09 15:00:35 +0100
commit6c1723abeb4e0580efec05a655343f46521fc265 (patch)
treeb2b1166441808a507d87a88cb7009a809893a37d
parente6fb6cedf3ecbde6f01d4753d7d05d0c52827fce (diff)
downloadspark-6c1723abeb4e0580efec05a655343f46521fc265.tar.gz
spark-6c1723abeb4e0580efec05a655343f46521fc265.tar.bz2
spark-6c1723abeb4e0580efec05a655343f46521fc265.zip
[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
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala7
1 files changed, 1 insertions, 6 deletions
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 39308e5ae1..aee51bf22d 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("[", ",", "...")