Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/7166#discussion_r34194050
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixture.scala ---
@@ -140,6 +143,10 @@ class GaussianMixture private (
// Get length of the input vectors
val d = breezeData.first().length
+ // Logic for when to distribute the computation of the
[[MultivariateGaussian]]s
+ val numPartitions = math.min(k, 1024)
+ val distributeGaussians = (k - k.toDouble / numPartitions) /
numPartitions * d > 25
--- End diff --
`numPartitions` might not equal to number of available executors. We can
simply assume that we have enough executors to distribute the work. If `k` is
large, `(k - 1) / k` is very close to `1` and hence we don't really care. So
let's still keep `(k - 1) / k * d > 25` (better with comments about the
heuristic), which is essentially `d > 25` but takes care of the case when `k`
is really small.
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]