-
- Downloads
[SPARK-16719][ML] Random Forests should communicate fewer trees on each iteration
## What changes were proposed in this pull request? RandomForest currently sends the entire forest to each worker on each iteration. This is because (a) the node queue is FIFO and (b) the closure references the entire array of trees (topNodes). (a) causes RFs to handle splits in many trees, especially early on in learning. (b) sends all trees explicitly. This PR: (a) Change the RF node queue to be FILO (a stack), so that RFs tend to focus on 1 or a few trees before focusing on others. (b) Change topNodes to pass only the trees required on that iteration. ## How was this patch tested? Unit tests: * Existing tests for correctness of tree learning * Manually modifying code and running tests to verify that a small number of trees are communicated on each iteration * This last item is hard to test via unit tests given the current APIs. Author: Joseph K. Bradley <joseph@databricks.com> Closes #14359 from jkbradley/rfs-fewer-trees.
Showing
- mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala 33 additions, 21 deletions...in/scala/org/apache/spark/ml/tree/impl/RandomForest.scala
- mllib/src/test/scala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala 13 additions, 13 deletions...ala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala
Please register or sign in to comment