Github user yanboliang commented on a diff in the pull request: https://github.com/apache/spark/pull/8552#discussion_r39357714 --- Diff: mllib/src/main/scala/org/apache/spark/ml/tree/treeParams.scala --- @@ -393,11 +383,18 @@ private[ml] trait GBTParams extends TreeEnsembleParams with HasMaxIter { /** @group setParam */ def setMaxIter(value: Int): this.type = set(maxIter, value) - /** @group setParam */ - def setStepSize(value: Double): this.type = set(stepSize, value) - - /** @group getParam */ - final def getStepSize: Double = $(stepSize) + /** + * Step size (a.k.a. learning rate) in interval (0, 1] for shrinking the contribution of each + * estimator. + * (default = 0.1) + * @group setParam + */ + def setStepSize(value: Double): this.type = { + if (!ParamValidators.inRange(0, 1, lowerInclusive = false, upperInclusive = true)(value)) { + throw new IllegalArgumentException(s"GBT parameter stepSize given invalid value $value.") + } + set(stepSize, value) --- End diff -- OK, done.
--- 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