Uh oh!
There was an error while loading. Please reload this page.
[SPARK-22884][ML][TESTS] ML test for StructuredStreaming: spark.ml.clustering - #20319
[SPARK-22884][ML][TESTS] ML test for StructuredStreaming: spark.ml.clustering#20319smurakozi wants to merge 5 commits into
Conversation
| import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder | ||
| private[clustering] object Encoders { | ||
| implicit val vectorEncoder = ExpressionEncoder[Vector]() |
There was a problem hiding this comment.
Is there a better solution to provide an implicit Encoder[Vector] for testTransformer?
Is it ok here, or is there a better place for it?
e.g. org.apache.spark.mllib.util.MLlibTestSparkContext.testImplicits
There was a problem hiding this comment.
Thanks for asking; you shouldn't need to do this. I'll comment on BisectingKMeansSuite.scala
about using testImplicits instead. You basically just need to import testImplicits._ and use Tuple1 for the type param for testTransformer.
squito
commented
Jan 19, 2018
Jenkins, add to whitelist |
SparkQA
commented
Jan 19, 2018
Test build #86391 has finished for PR 20319 at commit
|
smurakozi
commented
Jan 19, 2018
@jkbradley could you check out this change, please? |
SparkQA
commented
Jan 22, 2018
Test build #86479 has finished for PR 20319 at commit
|
jkbradley
commented
Apr 6, 2018
@smurakozi Thanks for the PR! I have bandwidth to review this now. Do you have time to rebase this to fix the merge conflicts? |
WeichenXu123
commented
Apr 9, 2018
@smurakozi Thanks for the PR! Could you resolve conflicts first? and then I will make a review. If you're busy I can also take over it. |
SparkQA
commented
Apr 9, 2018
Test build #89063 has finished for PR 20319 at commit
|
@jkbradley, @WeichenXu123 thanks for checking it out. I've resolved the conflicts, build is green. |
jkbradley
commented
Apr 17, 2018
Reviewing now! |
| import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder | ||
| private[clustering] object Encoders { | ||
| implicit val vectorEncoder = ExpressionEncoder[Vector]() |
There was a problem hiding this comment.
Thanks for asking; you shouldn't need to do this. I'll comment on BisectingKMeansSuite.scala
about using testImplicits instead. You basically just need to import testImplicits._ and use Tuple1 for the type param for testTransformer.
| extends SparkFunSuite with MLlibTestSparkContext with DefaultReadWriteTest { | ||
| class BisectingKMeansSuite extends MLTest with DefaultReadWriteTest { | ||
| import Encoders._ |
| // Verify we hit the edge case | ||
| assert(numClusters < k && numClusters > 1) | ||
| testTransformerByGlobalCheckFunc[Vector](sparseDataset.toDF(), model, "prediction") { rows => |
There was a problem hiding this comment.
Use Tuple1[Vector] instead of Vector
| val clusters = rows.map(_.getAs[Int](predictionColName)).toSet | ||
| assert(clusters.size === k) | ||
| assert(clusters === Set(0, 1, 2, 3, 4)) | ||
| assert(model.computeCost(dataset) < 0.1) |
There was a problem hiding this comment.
These checks which do not use "rows" should go outside of testTransformerByGlobalCheckFunc
jkbradley
commented
May 1, 2018
@smurakozi Do you have time to update this? I did a full review, though it now has a small merge conflict. Thanks! |
jkbradley
commented
May 17, 2018
I'm going to take this over to get this done, but @smurakozi you'll be the primary author. I'll link the PR here in a minute |
jkbradley
commented
May 17, 2018
Done! Here it is: #21358 @smurakozi Could you please close this issue and help review the new PR if you have time? Thanks! |
## What changes were proposed in this pull request? Converting clustering tests to also check code with structured streaming, using the ML testing infrastructure implemented in SPARK-22882. This PR is a new version of #20319 Author: Sandor Murakozi <smurakozi@gmail.com> Author: Joseph K. Bradley <joseph@databricks.com> Closes#21358 from jkbradley/smurakozi-SPARK-22884.
AmplabJenkins
commented
Jun 9, 2018
Can one of the admins verify this patch? |
Closesapache#17422Closesapache#17619Closesapache#18034Closesapache#18229Closesapache#18268Closesapache#17973Closesapache#18125Closesapache#18918Closesapache#19274Closesapache#19456Closesapache#19510Closesapache#19420Closesapache#20090Closesapache#20177Closesapache#20304Closesapache#20319Closesapache#20543Closesapache#20437Closesapache#21261Closesapache#21726Closesapache#14653Closesapache#13143Closesapache#17894Closesapache#19758Closesapache#12951Closesapache#17092Closesapache#21240Closesapache#16910Closesapache#12904Closesapache#21731Closesapache#21095 Added: Closesapache#19233Closesapache#20100Closesapache#21453Closesapache#21455Closesapache#18477 Added: Closesapache#21812Closesapache#21787 Author: hyukjinkwon <gurwls223@apache.org> Closesapache#21781 from HyukjinKwon/closing-prs.
What changes were proposed in this pull request?
Converting clustering tests to also check code with structured streaming, using the ML testing infrastructure implemented in SPARK-22882.
How was this patch tested?
N/A