Github user imatiach-msft commented on the issue:

    https://github.com/apache/spark/pull/16355
  
    @carocat @filousen 
    Please look at these changes that I updated on December 28:
    -        val height = math.sqrt(Seq(leftIndex, rightIndex).map { childIndex 
=> 
    +        val indexes = Seq(leftIndex, 
rightIndex).filter(clusters.contains(_))
    +        val height = math.sqrt(indexes.map { childIndex => 
               KMeans.fastSquaredDistance(center, clusters(childIndex).center) 
             }.max) 
    -        val left = buildSubTree(leftIndex) 
    -        val right = buildSubTree(rightIndex) 
    -        new ClusteringTreeNode(index, size, center, cost, height, 
Array(left, right)) 
    +        val children = indexes.map(buildSubTree(_)).toArray 
    +        new ClusteringTreeNode(index, size, center, cost, height, 
children) 


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