[
https://issues.apache.org/jira/browse/SPARK-2599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14068387#comment-14068387
]
Sean Owen commented on SPARK-2599:
----------------------------------
The problem is I can't express a lot of test conditions. See above for an
example, but here's another opposite one: what if I want to test for 50 +/- 1
(absolute error)? If epsilon = 1.0, and the result is 55, I want it to fail,
but it will pass since it is within 1.0 (100%) as a relative error. I can't
express this test at all and it's not an obscure case.
I'd still favor fixing this by sticking to absolute errors. Relative errors can
always be expressed by the test caller since the test caller knows the right
answer.
(Or, one can add another method for relative tests. I just don't think absolute
and relative can go together in one method.)
> 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)