xiaoa6435 commented on code in PR #42431:
URL: https://github.com/apache/spark/pull/42431#discussion_r1292926346
##########
mllib/src/main/scala/org/apache/spark/mllib/stat/correlation/SpearmanCorrelation.scala:
##########
@@ -65,8 +65,8 @@ private[stat] object SpearmanCorrelation extends Correlation
with Logging {
output
}
iter.flatMap { case (((j, v), uid), rank) =>
- // If we see a new value or cachedUids is too big, we flush ids with
their average rank.
- if (j != preCol || v != preVal || cachedUids.size >= 10000000) {
Review Comment:
> I think this limitation is on purpose.
>
> I think we could either 1, document this limitation; 2, or add a new
parameter for it.
>
> also cc @srowen @WeichenXu123
the intent may be to prevent OOM, but it causes some other problems
- flush when ties size > N can't give a approximate results, and in many
cases, is far from the correct results, as it results in distinct average ranks
for tied values
- ties size > 10_000_000 are not uncommon. real-world data tends to exhibit
skewness with a substantial number of zero values
- alternative workaound may need multiple traversal iterations
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]