Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8552#discussion_r39285255
  
    --- 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 --
    
    @yanboliang Putting the check in `setStepSize` is not sufficient because 
users can bypass it by specifying the value in other places, e.g., `gbt.fit(df, 
gbt.stepSize -> 0.5)`. We need to put the check in `validateParams`.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to