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

    https://github.com/apache/spark/pull/916#discussion_r13210082
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
    @@ -421,6 +431,22 @@ abstract class RDD[T: ClassTag](
         Utils.randomizeInPlace(samples, rand).take(total)
       }
     
    +  private[spark] def computeFraction(num: Int, total: Long, 
withReplacement: Boolean) : Double = {
    +    val fraction = num.toDouble / total
    +    if (withReplacement) {
    +      var numStDev = 5
    +      if (num < 12) {
    +        // special case to guarantee sample size for small s
    +        numStDev = 9
    +      }
    +      fraction + numStDev * math.sqrt(fraction / total)
    --- End diff --
    
    I think I understand what this expression is trying to bound but if you 
have a moment to comment it, would be great for the likes of me!


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

Reply via email to