GitHub user hhbyyh opened a pull request:
https://github.com/apache/spark/pull/4183
[SPARK-5384][mllib] Vectors.sqdist return inconsistent result for
sparse/dense vectors when the vectors have different lengths
JIRA issue: https://issues.apache.org/jira/browse/SPARK-5384
Currently `Vectors.sqdist` return inconsistent result for sparse/dense
vectors when the vectors have different lengths, please refer to JIRA for sample
PR scope:
Unify the sqdist logic for dense/sparse vectors and fix the inconsistency,
also remove the possible sparse to dense conversion in the original code.
For reviewers:
Maybe we should first discuss what's the correct behavior.
1. Vectors for sqdist must have the same length, like in breeze?
2. If they can have different lengths, what's the correct result for
sqdist? (should the extra part get into calculation?)
I'll update PR with more optimization and additional ut afterwards. Thanks.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hhbyyh/spark fixDouble
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/4183.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4183
----
commit 54cbf97b3b08136ac77d7f2e6265aec9c5206a4b
Author: Yuhao Yang <[email protected]>
Date: 2015-01-24T16:03:37Z
fix Vectors.sqdist inconsistence
----
---
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]