Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15359#discussion_r81907248
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/NaiveBayes.scala ---
    @@ -177,7 +177,7 @@ class NaiveBayes @Since("1.5.0") (
         val numDocuments = aggregated.map(_._2._1).sum
     
         val piArray = Array.fill[Double](numLabels)(0.0)
    -    val thetaArrays = Array.fill[Double](numLabels, numFeatures)(0.0)
    +    val thetaArray = Array.fill[Double](numLabels * numFeatures)(0.0)
    --- End diff --
    
    LGTM. While we're here, is it simpler / more efficient to just call `new 
Array[Double](...)` rather than also fill it with 0, which it's already 
initialized to?


---
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

Reply via email to