GitHub user yanboliang opened a pull request: https://github.com/apache/spark/pull/15826
[SPARK-14077][ML][FOLLOW-UP] Minor cleanups for NaiveBayes ## What changes were proposed in this pull request? * Refactor out ```trainWithLabelCheck``` and make ```mllib.NaiveBayes``` call into it. * Avoid capturing the outer object for ```modelType```. * Move ```requireNonnegativeValues``` and ```requireZeroOneBernoulliValues``` to companion object. ## How was this patch tested? Existing tests. You can merge this pull request into a Git repository by running: $ git pull https://github.com/yanboliang/spark spark-14077-2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/15826.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #15826 ---- commit d0f95fb9a4696f1932febd3e58501ddb8f14555a Author: Yanbo Liang <yblia...@gmail.com> Date: 2016-11-09T07:16:50Z Refactor out trainWithLabelCheck. commit 8cf2a80e2b3df2038387aa50c03b628ce26d70b0 Author: Yanbo Liang <yblia...@gmail.com> Date: 2016-11-09T07:46:20Z Avoid capturing the outer object. commit 48f7e868cad81f49ca6206031572424fa15ce74d Author: Yanbo Liang <yblia...@gmail.com> Date: 2016-11-09T08:35:46Z Update some variables to more private. ---- --- 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