You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Peng Meng (JIRA)" <ji...@apache.org> on 2016/08/24 06:15:21 UTC

[jira] [Commented] (SPARK-17207) Comparing Vector in relative tolerance or absolute tolerance in UnitTests error

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

Peng Meng commented on SPARK-17207:
-----------------------------------

This is caused by two Vector zip problem:
    def absTol(eps: Double): CompareVectorRightSide = CompareVectorRightSide(
      (x: Vector, y: Vector, eps: Double) => {
        x.toArray.zip(y.toArray).forall(x => x._1 ~= x._2 absTol eps)  
      }, x, eps, ABS_TOL_MSG)

// forall () always return true if x or y is zero element Vector





> Comparing Vector in relative tolerance or absolute tolerance in UnitTests error 
> --------------------------------------------------------------------------------
>
>                 Key: SPARK-17207
>                 URL: https://issues.apache.org/jira/browse/SPARK-17207
>             Project: Spark
>          Issue Type: Bug
>          Components: ML, MLlib
>            Reporter: Peng Meng
>
> The result of compare two vectors using UnitTests (org.apache.spark.mllib.util.TestingUtils) is not right sometime.
> For example:
> val a = Vectors.dense(Arrary(1.0, 2.0))
> val b = Vectors.zeros(0)
> a ~== b absTol 1e-1 // the result is true. 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org