Skip to content

Commit

Permalink
use mapValues
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxr committed Aug 18, 2014
1 parent 0925efa commit 2821b3b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package org.apache.spark.mllib.regression
import org.apache.spark.Logging
import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.streaming.StreamingContext._
import org.apache.spark.streaming.dstream.DStream

/**
Expand Down Expand Up @@ -117,6 +118,6 @@ abstract class StreamingLinearAlgorithm[
logError(msg)
throw new IllegalArgumentException(msg)
}
data.mapPartitions(_.map(x => (x._1, model.predict(x._2))), preservePartitioning = true)
data.mapValues(model.predict)
}
}

0 comments on commit 2821b3b

Please sign in to comment.