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

    https://github.com/apache/spark/pull/11553#discussion_r55964697
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/feature/QuantileDiscretizer.scala ---
    @@ -49,6 +49,20 @@ private[feature] trait QuantileDiscretizerBase extends 
Params
     
       /** @group getParam */
       def getNumBuckets: Int = getOrDefault(numBuckets)
    +
    +  /**
    +   * Relative error (see approxQuantile documentation for description).  
Must be >= 0.
    +   * default: 0.01
    +   * @group param
    +   */
    +  val relativeError = new DoubleParam(this, "relativeError", "The relative 
target precision " +
    +    "for approxQuantile",
    +    ParamValidators.gtEq(0.0))
    +  setDefault(relativeError -> 0.01)
    +
    +  /** @group Param */
    +  def getRelativeError: Double = get(relativeError).getOrElse
    +    { math.min(0.01, 1.0 / (10.0 * getNumBuckets)) }
    --- End diff --
    
    @oliverpierson what I had in mind was more a floor on the error... so by 
default `math.max(0.001, math.min(0.01, 1.0 / (10.0 * getNumBuckets)))` or 
something.
    
    So 5 buckets => 2% error, 100 buckets => 0.1% error instead of 0.01% error.


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