-
- Downloads
[SPARK-4197] [mllib] GradientBoosting API cleanup and examples in Scala, Java
### Summary * Made it easier to construct default Strategy and BoostingStrategy and to set parameters using simple types. * Added Scala and Java examples for GradientBoostedTrees * small cleanups and fixes ### Details GradientBoosting bug fixes (“bug” = bad default options) * Force boostingStrategy.weakLearnerParams.algo = Regression * Force boostingStrategy.weakLearnerParams.impurity = impurity.Variance * Only persist data if not yet persisted (since it causes an error if persisted twice) BoostingStrategy * numEstimators: renamed to numIterations * removed subsamplingRate (duplicated by Strategy) * removed categoricalFeaturesInfo since it belongs with the weak learner params (since boosting can be oblivious to feature type) * Changed algo to var (not val) and added BeanProperty, with overload taking String argument * Added assertValid() method * Updated defaultParams() method and eliminated defaultWeakLearnerParams() since that belongs in Strategy Strategy (for DecisionTree) * Changed algo to var (not val) and added BeanProperty, with overload taking String argument * Added setCategoricalFeaturesInfo method taking Java Map. * Cleaned up assertValid * Changed val’s to def’s since parameters can now be changed. CC: manishamde mengxr codedeft Author: Joseph K. Bradley <joseph@databricks.com> Closes #3094 from jkbradley/gbt-api and squashes the following commits: 7a27e22 [Joseph K. Bradley] scalastyle fix 52013d5 [Joseph K. Bradley] Merge remote-tracking branch 'upstream/master' into gbt-api e9b8410 [Joseph K. Bradley] Summary of changes
Showing
- examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostedTrees.java 126 additions, 0 deletions...apache/spark/examples/mllib/JavaGradientBoostedTrees.java
- examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala 45 additions, 19 deletions.../org/apache/spark/examples/mllib/DecisionTreeRunner.scala
- examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTrees.scala 146 additions, 0 deletions...rg/apache/spark/examples/mllib/GradientBoostedTrees.scala
- mllib/src/main/scala/org/apache/spark/mllib/tree/GradientBoosting.scala 52 additions, 117 deletions.../scala/org/apache/spark/mllib/tree/GradientBoosting.scala
- mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/BoostingStrategy.scala 39 additions, 39 deletions...che/spark/mllib/tree/configuration/BoostingStrategy.scala
- mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/Strategy.scala 40 additions, 11 deletions.../org/apache/spark/mllib/tree/configuration/Strategy.scala
- mllib/src/test/scala/org/apache/spark/mllib/tree/GradientBoostingSuite.scala 14 additions, 20 deletions...a/org/apache/spark/mllib/tree/GradientBoostingSuite.scala
Loading
Please register or sign in to comment