Github user holdenk commented on a diff in the pull request: https://github.com/apache/spark/pull/8241#discussion_r37365280 --- Diff: mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala --- @@ -83,9 +86,13 @@ class NaiveBayesModel private[spark] ( } override def predict(testData: RDD[Vector]): RDD[Double] = { - val bcModel = testData.context.broadcast(this) + bcModel match { --- End diff -- So you seem to have this code pattern repeated in a few places through the file, maybe we could factor this out into a common function. Also this pattern is replicated across a few of your PRs, maybe adding a trait with this shared logic would be even more awesome?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org