Skip to content

[SPARK-17207][MLLIB]fix comparing Vector bug in TestingUtils#14785

Closed
mpjlu wants to merge 6 commits intoapache:masterfrom
mpjlu:testUtils
Closed

[SPARK-17207][MLLIB]fix comparing Vector bug in TestingUtils#14785
mpjlu wants to merge 6 commits intoapache:masterfrom
mpjlu:testUtils

Conversation

@mpjlu
Copy link

@mpjlu mpjlu commented Aug 24, 2016

What changes were proposed in this pull request?

fix comparing Vector bug in TestingUtils.
There is the same bug for Matrix comparing. How to check the length of Matrix should be discussed first.

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)

(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)

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)
if (x.size != y.size) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just x.size == y.size && ...?
I think this also needs to be done for the matrix ops below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks.
How about check matrix length by
x.numRows == y.numRows && x.numCols == y.numCols && ... ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with that, yes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code is updated. Thanks @srowen

@srowen
Copy link
Member

srowen commented Aug 24, 2016

Jenkins test this please

@srowen
Copy link
Member

srowen commented Aug 24, 2016

Jenkins add to whitelist

@SparkQA
Copy link

SparkQA commented Aug 24, 2016

Test build #64349 has finished for PR 14785 at commit e1fca68.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dbtsai
Copy link
Member

dbtsai commented Aug 25, 2016

Can you also fix https://github.com/apache/spark/blob/master/mllib-local/src/test/scala/org/apache/spark/ml/util/TestingUtils.scala? Please add tests showing the issue is addressed. Thanks.

@mpjlu
Copy link
Author

mpjlu commented Aug 25, 2016

Sure, I will fix it, and add test cases. thanks. @dbtsai ,

@mpjlu
Copy link
Author

mpjlu commented Aug 25, 2016

Hi @dbtsai , PR 2294 added Matrix comparing in TestingUtils, but did not add any test cases in TestingUtilsSuite. I did not add test cases for Matrix comparing in the PR either.
If Matrix comparing cases are required. I can add all test cases them, not only test this PR, like Vector comparing test cases.

@SparkQA
Copy link

SparkQA commented Aug 25, 2016

Test build #64418 has finished for PR 14785 at commit f4a60fc.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Aug 25, 2016

Test build #64424 has finished for PR 14785 at commit 1ec924c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dbtsai
Copy link
Member

dbtsai commented Aug 25, 2016

Please also add test cases for matrices. Thanks.

@SparkQA
Copy link

SparkQA commented Aug 26, 2016

Test build #64462 has finished for PR 14785 at commit b59893f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dbtsai
Copy link
Member

dbtsai commented Aug 26, 2016

LGTM. Merged into master. Thanks.

@asfgit asfgit closed this in c0949dc Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants