You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by MLnick <gi...@git.apache.org> on 2016/03/09 11:33:26 UTC

[GitHub] spark pull request: [SPARK-13600] [MLlib] Use approxQuantile from ...

Github user MLnick commented on the pull request:

    https://github.com/apache/spark/pull/11553#issuecomment-194231520
  
    @oliverpierson `$(relativeError)` is just an alias for `getOrDefault`, so you could remove `setDefault(relativeError -> 0.01)` and do something like:
    
    ```scala
    QuantileDiscretizerBase
    ...
      def getRelativeError: Double = get(relativeError).getOrElse {
        math.min(0.1, 1.0 / (10 * getNumBuckets))
      }
    ...
    QuantileDiscretizer
    ...
    val splits = dataset.stat.approxQuantile($(inputCol),
          (0.0 to 1.0 by 1.0/$(numBuckets)).toArray, getRelativeError)
    ...
    ```
    If we go this route, it should of course be documented and tests updated / added. Also, it may make sense to put a floor on the auto `relativeError` in case a user sets a very large number of buckets (e.g. a few hundred).



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org