[ 
https://issues.apache.org/jira/browse/SPARK-9750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14696046#comment-14696046
 ] 

Joseph K. Bradley commented on SPARK-9750:
------------------------------------------

My understanding is as follows.  Does this sound right?

Terminology:
* literal equality: ignores semantics of tranpose, sparsity, etc., and simply 
compares objects for exact equality
* semantic equality: equality in linear algebra semantics, e.g., as Breeze does

Status before this PR:
* Python
** Vectors: eq implements literal equality.  Default hash.
** Matrices: eq implements semantic equality.  Default hash. **-->This is a 
bug.**
* Scala
** Vectors: equals() implements semantic equality.  hashCode() uses first 16 
elements.
** DenseMatrix: equals() implements semantic equality.  hashCode() uses all 
elements.
** SparseMatrix: default equals(), hashCode().

Thus, there is one bug which we could fix.  But it's probably not significant 
since it's been in MLlib for a while.

> SparseMatrix should override equals
> -----------------------------------
>
>                 Key: SPARK-9750
>                 URL: https://issues.apache.org/jira/browse/SPARK-9750
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib
>            Reporter: Feynman Liang
>            Assignee: Feynman Liang
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> [SparseMatrix|https://github.com/apache/spark/blob/9897cc5e3d6c70f7e45e887e2c6fc24dfa1adada/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala#L479]
>  should override equals to ensure that two instances of the same matrix are 
> equal.
> This implementation should take into account the {{isTransposed}} flag and 
> {{values}} may not be in the same order.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to