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

    https://github.com/apache/spark/pull/15913#discussion_r89439490
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/tree/treeParams.scala ---
    @@ -443,12 +425,11 @@ private[ml] trait GBTParams extends 
TreeEnsembleParams with HasMaxIter with HasS
        * (default = 0.1)
        * @group setParam
        */
    -  def setStepSize(value: Double): this.type = set(stepSize, value)
    -
    -  override def validateParams(): Unit = {
    +  def setStepSize(value: Double): this.type = {
         require(ParamValidators.inRange(0, 1, lowerInclusive = false, 
upperInclusive = true)(
    --- End diff --
    
    The original ```validateParams()``` was only used to check for interactions 
between parameters. Parameter value checks which do not depend on other 
parameters are handled by ````Param.validate()``` at the definition, i.e.
    ```
    final val k = new IntParam(this, "k", "The number of clusters to create. " +
        "Must be > 1.", ParamValidators.gt(1))
    ```
    However, ```stepSize``` was a trait and inherited by lots of sub-classes 
which have different constraints for this parameter, so I add the check at 
setter.


---
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