You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2017/06/12 09:58:55 UTC

[GitHub] spark pull request #18276: [SPARK-21057][ML] Do not use a PascalDistribution...

GitHub user srowen opened a pull request:

    https://github.com/apache/spark/pull/18276

    [SPARK-21057][ML] Do not use a PascalDistribution in countApprox

    ## What changes were proposed in this pull request?
    
    Use Poisson analysis for approx count in all cases.
    
    ## How was this patch tested?
    
    Existing tests.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/srowen/spark SPARK-21057

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/18276.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18276
    
----
commit 8a1471318cc5b9c0eb0c19ff6db5fc90d1383a24
Author: Sean Owen <so...@cloudera.com>
Date:   2017-06-12T09:57:57Z

    Use Poisson analysis for approx count in all cases

----


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


[GitHub] spark pull request #18276: [SPARK-21057][ML] Do not use a PascalDistribution...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/18276


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


[GitHub] spark pull request #18276: [SPARK-21057][ML] Do not use a PascalDistribution...

Posted by lovasoa <gi...@git.apache.org>.
Github user lovasoa commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18276#discussion_r122086218
  
    --- Diff: core/src/main/scala/org/apache/spark/partial/CountEvaluator.scala ---
    @@ -48,22 +48,11 @@ private[spark] class CountEvaluator(totalOutputs: Int, confidence: Double)
     private[partial] object CountEvaluator {
     
       def bound(confidence: Double, sum: Long, p: Double): BoundedDouble = {
    -    // Let the total count be N. A fraction p has been counted already, with sum 'sum',
    -    // as if each element from the total data set had been seen with probability p.
    -    val dist =
    -      if (sum <= 10000) {
    -        // The remaining count, k=N-sum, may be modeled as negative binomial (aka Pascal),
    -        // where there have been 'sum' successes of probability p already. (There are several
    -        // conventions, but this is the one followed by Commons Math3.)
    -        new PascalDistribution(sum.toInt, p)
    -      } else {
    -        // For large 'sum' (certainly, > Int.MaxValue!), use a Poisson approximation, which has
    -        // a different interpretation. "sum" elements have been observed having scanned a fraction
    -        // p of the data. This suggests data is counted at a rate of sum / p across the whole data
    -        // set. The total expected count from the rest is distributed as
    -        // (1-p) Poisson(sum / p) = Poisson(sum*(1-p)/p)
    -        new PoissonDistribution(sum * (1 - p) / p)
    -      }
    +    // "sum" elements have been observed having scanned a fraction
    +    // p of the data. This suggests data is counted at a rate of sum / p across the whole data
    +    // set. The total expected count from the rest is distributed as
    +    // (1-p) Poisson(sum / p) = Poisson(sum*(1-p)/p)
    +    val dist = new PoissonDistribution(sum * (1 - p) / p)
    --- End diff --
    
    I know it is a little late for a review, but now that we have a single distribution, it would make the code clearer to estimate directly the total count with the poisson distribution. That is removing the `1-p` here and the `sum + ` in the final BoundedDouble.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    **[Test build #77938 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77938/testReport)** for PR 18276 at commit [`8a14713`](https://github.com/apache/spark/commit/8a1471318cc5b9c0eb0c19ff6db5fc90d1383a24).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    Merged build finished. Test FAILed.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    **[Test build #77931 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77931/testReport)** for PR 18276 at commit [`8a14713`](https://github.com/apache/spark/commit/8a1471318cc5b9c0eb0c19ff6db5fc90d1383a24).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    **[Test build #77938 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77938/testReport)** for PR 18276 at commit [`8a14713`](https://github.com/apache/spark/commit/8a1471318cc5b9c0eb0c19ff6db5fc90d1383a24).


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77938/
    Test FAILed.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77931/
    Test FAILed.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    Merged build finished. Test PASSed.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    Retest this please.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77987/
    Test PASSed.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    Merged build finished. Test FAILed.


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    **[Test build #77987 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77987/testReport)** for PR 18276 at commit [`f5311f9`](https://github.com/apache/spark/commit/f5311f998231dd85395e502675edb6fad92a4a60).


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    Merged to master


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    **[Test build #77931 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77931/testReport)** for PR 18276 at commit [`8a14713`](https://github.com/apache/spark/commit/8a1471318cc5b9c0eb0c19ff6db5fc90d1383a24).


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


[GitHub] spark issue #18276: [SPARK-21057][ML] Do not use a PascalDistribution in cou...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18276
  
    **[Test build #77987 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77987/testReport)** for PR 18276 at commit [`f5311f9`](https://github.com/apache/spark/commit/f5311f998231dd85395e502675edb6fad92a4a60).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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