[
https://issues.apache.org/jira/browse/SPARK-2599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14068302#comment-14068302
]
Doris Xin commented on SPARK-2599:
----------------------------------
I completely agree that convoluting absolute and relative differences can be
dangerous, but perhaps not so much in the case where we're just trying to see
if two numbers are almost equal to each other (i.e. epsilon is really small,
~1e-10). To avoid the problem you suggested, we'd have to advise users to use
absolute difference as a general rule of thumb, which is fairly conventional.
The relative difference support can be thought of as the "cherry on top" for
large number comparisons.
> almostEquals mllib.util.TestingUtils does not behave as expected when
> comparing against 0.0
> -------------------------------------------------------------------------------------------
>
> Key: SPARK-2599
> URL: https://issues.apache.org/jira/browse/SPARK-2599
> Project: Spark
> Issue Type: Bug
> Components: MLlib
> Reporter: Doris Xin
> Priority: Minor
>
> DoubleWithAlmostEquals.almostEquals, when used to compare a number with 0.0,
> would always produce an epsilon of 1 >> 1e-10, causing false failure when
> comparing very small numbers with 0.0.
--
This message was sent by Atlassian JIRA
(v6.2#6252)