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

    https://github.com/apache/spark/pull/18868#discussion_r131605981
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala ---
    @@ -1107,9 +1108,11 @@ private[spark] object RandomForest extends Logging {
             mutableTreeToNodeToIndexInfo
               .getOrElseUpdate(treeIndex, new mutable.HashMap[Int, 
NodeIndexInfo]())(node.id)
               = new NodeIndexInfo(numNodesInGroup, featureSubset)
    +        numNodesInGroup += 1
    +        memUsage += nodeMemUsage
    +      } else {
    +        flag = false
    --- End diff --
    
    We cannot clear stack here, because the nodes in the stack are used for all 
iteration. 
    Native scala doesn't support break, we have to import other package to use 
break, seems not necessary. 
    We cannot use nodeStack.pop at the top, because we don't know whether it 
can be grouped here.
    How about change "flag" to "groupDone" means Group is done, don't need to 
loop again.


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