Skip to content

Conversation

@viirya
Copy link
Member

@viirya viirya commented Jan 1, 2015

Related to #3643. Follow the previous suggestion to add unit test for sqdist in VectorsSuite.

@SparkQA
Copy link

SparkQA commented Jan 1, 2015

Test build #24985 has finished for PR 3869 at commit c36be68.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • SparkSubmit.printErrorAndExit(s"Cannot load main class from JAR $primaryResource")
    • class BinaryClassificationMetrics(

@viirya viirya changed the title Add unit test for sqdist [SPARK-5050] Add unit test for sqdist Jan 1, 2015
@jkbradley
Copy link
Member

@viirya Could you please add the "[mllib]" tag to the title?

val v4 = Vectors.sparse(n, indices.slice(0, m - 10),
indices.map(i => a(i) + 0.5).slice(0, m - 10))
val squaredDist = breezeSquaredDistance(v2.toBreeze, v4.toBreeze)
val fastSquaredDist =
Copy link
Member

Choose a reason for hiding this comment

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

Can fit on 1 line instead of 2

@jkbradley
Copy link
Member

@viirya Looks OK to me, except for the tiny comments. Thanks!

At some point, it might be nice to replace these tests with ones using random dense & sparse vectors (with random sparsity patterns). If you are interested in doing that, I can send you a method for generating random sparse vectors which I used for the timing tests.

@viirya viirya changed the title [SPARK-5050] Add unit test for sqdist [SPARK-5050][Mllib] Add unit test for sqdist Jan 3, 2015
@viirya
Copy link
Member Author

viirya commented Jan 3, 2015

@jkbradley Thanks. I made a more proper unit test with random sparsity pattern.

@SparkQA
Copy link

SparkQA commented Jan 3, 2015

Test build #25008 has finished for PR 3869 at commit b789f42.

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

@SparkQA
Copy link

SparkQA commented Jan 3, 2015

Test build #25009 has finished for PR 3869 at commit 39a3ca6.

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

@jkbradley
Copy link
Member

(I meant those comments for the main text but accidentally added them to the commit instead.)

@jkbradley
Copy link
Member

Other than those small comments, it looks good. Thanks!

@SparkQA
Copy link

SparkQA commented Jan 4, 2015

Test build #25026 has finished for PR 3869 at commit 90a08f3.

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

@jkbradley
Copy link
Member

@viirya LGTM Thanks!

CC: @mengxr

@@ -175,6 +177,33 @@ class VectorsSuite extends FunSuite {
assert(v.size === x.rows)
}

test("sqdist") {
val random = new Random(System.nanoTime())
Copy link
Contributor

Choose a reason for hiding this comment

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

new Random uses a random seed already.

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25096 has finished for PR 3869 at commit fb743da.

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

@mengxr
Copy link
Contributor

mengxr commented Jan 6, 2015

LGTM. Merged into master. Thanks!

@asfgit asfgit closed this in bb38ebb Jan 6, 2015
@viirya viirya deleted the sqdist_test branch December 27, 2023 18:31
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