Skip to content
Snippets Groups Projects
Commit 6c1723ab authored by MechCoder's avatar MechCoder Committed by Sean Owen
Browse files

[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
parent e6fb6ced
No related branches found
No related tags found
No related merge requests found
......@@ -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("[", ",", "...")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment