-
- Downloads
[SPARK-3724][ML] RandomForest: More options for feature subset size.
## What changes were proposed in this pull request? This PR tries to support more options for feature subset size in RandomForest implementation. Previously, RandomForest only support "auto", "all", "sort", "log2", "onethird". This PR tries to support any given value to allow model search. In this PR, `featureSubsetStrategy` could be passed with: a) a real number in the range of `(0.0-1.0]` that represents the fraction of the number of features in each subset, b) an integer number (`>0`) that represents the number of features in each subset. ## How was this patch tested? Two tests `JavaRandomForestClassifierSuite` and `JavaRandomForestRegressorSuite` have been updated to check the additional options for params in this PR. An additional test has been added to `org.apache.spark.mllib.tree.RandomForestSuite` to cover the cases in this PR. Author: Yong Tang <yong.tang.github@outlook.com> Closes #11989 from yongtang/SPARK-3724.
Showing
- mllib/src/main/scala/org/apache/spark/ml/tree/impl/DecisionTreeMetadata.scala 5 additions, 0 deletions.../org/apache/spark/ml/tree/impl/DecisionTreeMetadata.scala
- mllib/src/main/scala/org/apache/spark/ml/tree/treeParams.scala 7 additions, 1 deletion.../src/main/scala/org/apache/spark/ml/tree/treeParams.scala
- mllib/src/main/scala/org/apache/spark/mllib/tree/RandomForest.scala 9 additions, 2 deletions...main/scala/org/apache/spark/mllib/tree/RandomForest.scala
- mllib/src/test/java/org/apache/spark/ml/classification/JavaRandomForestClassifierSuite.java 19 additions, 0 deletions...rk/ml/classification/JavaRandomForestClassifierSuite.java
- mllib/src/test/java/org/apache/spark/ml/regression/JavaRandomForestRegressorSuite.java 19 additions, 0 deletions...e/spark/ml/regression/JavaRandomForestRegressorSuite.java
- mllib/src/test/scala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala 36 additions, 0 deletions...ala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala
Loading
Please register or sign in to comment