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

    https://github.com/apache/spark/pull/15018#discussion_r92920619
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/regression/IsotonicRegression.scala 
---
    @@ -328,74 +336,68 @@ class IsotonicRegression private (private var 
isotonic: Boolean) extends Seriali
           return Array.empty
         }
     
    -    // Pools sub array within given bounds assigning weighted average 
value to all elements.
    -    def pool(input: Array[(Double, Double, Double)], start: Int, end: 
Int): Unit = {
    -      val poolSubArray = input.slice(start, end + 1)
    -
    -      val weightedSum = poolSubArray.map(lp => lp._1 * lp._3).sum
    -      val weight = poolSubArray.map(_._3).sum
    -
    -      var i = start
    -      while (i <= end) {
    -        input(i) = (weightedSum / weight, input(i)._2, input(i)._3)
    -        i = i + 1
    -      }
    +    /*
    +    Keeps track of the start and end indices of the blocks. 
blockBounds(start) gives the
    +    index of the end of the block and blockBounds(end) gives the index of 
the start of the
    --- End diff --
    
    blockBounds(start) is the _end_ of a block? this is reflected in your 
helper functions below but it seems reversed. Can you double check and 
elaborate a bit?


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

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

Reply via email to