Skip to content

Commit 6c1723a

Browse files
MechCodersrowen
authored andcommitted
[SPARK-8140] [MLLIB] Remove construct to get weights in StreamingLinearAlgorithm
Author: MechCoder <[email protected]> Closes apache#6720 from MechCoder/empty_model_check and squashes the following commits: 3a07de5 [MechCoder] Remove construct to get weights in StreamingLinearAlgorithm
1 parent e6fb6ce commit 6c1723a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,7 @@ abstract class StreamingLinearAlgorithm[
8383
throw new IllegalArgumentException("Model must be initialized before starting training.")
8484
}
8585
data.foreachRDD { (rdd, time) =>
86-
val initialWeights =
87-
model match {
88-
case Some(m) =>
89-
m.weights
90-
}
91-
model = Some(algorithm.run(rdd, initialWeights))
86+
model = Some(algorithm.run(rdd, model.get.weights))
9287
logInfo("Model updated at time %s".format(time.toString))
9388
val display = model.get.weights.size match {
9489
case x if x > 100 => model.get.weights.toArray.take(100).mkString("[", ",", "...")

0 commit comments

Comments
 (0)