-
- Downloads
[SPARK-13952][ML] Add random seed to GBT
## What changes were proposed in this pull request? `GBTClassifier` and `GBTRegressor` should use random seed for reproducible results. Because of the nature of current unit tests, which compare GBTs in ML and GBTs in MLlib for equality, I also added a random seed to MLlib GBT algorithm. I made alternate constructors in `mllib.tree.GradientBoostedTrees` to accept a random seed, but left them as private so as to not change the API unnecessarily. ## How was this patch tested? Existing unit tests verify that functionality did not change. Other ML algorithms do not seem to have unit tests that directly test the functionality of random seeding, but reproducibility with seeding for GBTs is effectively verified in existing tests. I can add more tests if needed. Author: sethah <seth.hendrickson16@gmail.com> Closes #11903 from sethah/SPARK-13952.
Showing
- mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala 3 additions, 5 deletions...la/org/apache/spark/ml/classification/GBTClassifier.scala
- mllib/src/main/scala/org/apache/spark/ml/regression/DecisionTreeRegressor.scala 1 addition, 1 deletion...rg/apache/spark/ml/regression/DecisionTreeRegressor.scala
- mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala 3 additions, 5 deletions...n/scala/org/apache/spark/ml/regression/GBTRegressor.scala
- mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala 18 additions, 12 deletions.../org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala
- mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala 12 additions, 3 deletions...main/scala/org/apache/spark/mllib/tree/DecisionTree.scala
- mllib/src/main/scala/org/apache/spark/mllib/tree/GradientBoostedTrees.scala 21 additions, 9 deletions...la/org/apache/spark/mllib/tree/GradientBoostedTrees.scala
- mllib/src/test/scala/org/apache/spark/ml/classification/GBTClassifierSuite.scala 3 additions, 1 deletion...g/apache/spark/ml/classification/GBTClassifierSuite.scala
- mllib/src/test/scala/org/apache/spark/ml/regression/GBTRegressorSuite.scala 3 additions, 1 deletion...la/org/apache/spark/ml/regression/GBTRegressorSuite.scala
- mllib/src/test/scala/org/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala 2 additions, 2 deletions...g/apache/spark/mllib/tree/GradientBoostedTreesSuite.scala
Loading
Please register or sign in to comment