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

    https://github.com/apache/spark/pull/20472#discussion_r165378109
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala ---
    @@ -1002,10 +1008,14 @@ private[spark] object RandomForest extends Logging {
           val numSplits = metadata.numSplits(featureIndex)
     
           // get count for each distinct value
    -      val (valueCountMap, numSamples) = 
featureSamples.foldLeft((Map.empty[Double, Int], 0)) {
    +      var (valueCountMap, numSamples) = 
featureSamples.foldLeft((Map.empty[Double, Int], 0)) {
    --- End diff --
    
    I'd probably avoid a `var` by using a new variable for `numSamples` here.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to