Skip to content

Conversation

@yinxusen
Copy link
Contributor

https://issues.apache.org/jira/browse/SPARK-11893

@jkbradley In order to share read/write with TrainValidationSplit, I move the SharedReadWrite out of CrossValidator into a new trait SharedReadWrite in the tunning package.

To reduce the repeated tests, I move the complex tests from CrossValidatorSuite to SharedReadWriteSuite, and create a fake validator called MyValidator to test the shared code.

With SharedReadWrite, potential newly added Validator can share the read/write common part, and only need to implement their extra params save/load.

@SparkQA
Copy link

SparkQA commented Nov 25, 2015

Test build #46685 has finished for PR 9971 at commit 71355ca.

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

@yinxusen
Copy link
Contributor Author

test it please

@SparkQA
Copy link

SparkQA commented Jan 11, 2016

Test build #49134 has finished for PR 9971 at commit 023371b.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yinxusen
Copy link
Contributor Author

test it please

@SparkQA
Copy link

SparkQA commented Jan 11, 2016

Test build #49140 has finished for PR 9971 at commit 8c02be2.

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

@yinxusen
Copy link
Contributor Author

Ping @jkbradley

@jkbradley
Copy link
Member

@yinxusen Hi, sorry for the long wait. I'd like to review this now. Could you please rebase from master?

@yinxusen
Copy link
Contributor Author

Sure will do it soon

Sent from my iPhone

On Mar 23, 2016, at 12:31, jkbradley [email protected] wrote:

@yinxusen Hi, sorry for the long wait. I'd like to review this now. Could you please rebase from master?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@yinxusen
Copy link
Contributor Author

test it please

@SparkQA
Copy link

SparkQA commented Mar 23, 2016

Test build #53973 has finished for PR 9971 at commit 7f2dd31.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yinxusen
Copy link
Contributor Author

test it please

@SparkQA
Copy link

SparkQA commented Mar 23, 2016

Test build #53976 has finished for PR 9971 at commit 581fc5b.

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

@jkbradley
Copy link
Member

Ok thanks! I'll review this now

@jkbradley
Copy link
Member

Initial comment: I like the idea of testing Validators jointly, but I don't think creating a MyValidator class is the best way since it involves a lot of new code and since that new code is mimicking what is already in CrossValidator. I'd prefer to keep the original CrossValidatorSuite tests since I believe those test the same functionality.

* Examine the given estimator (which may be a compound estimator) and extract a mapping
* from UIDs to corresponding [[Params]] instances.
*/
def getUidMap(instance: Params): Map[String, Params] = {
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to use this in CrossValidator as well? There is still a copy in CrossValidator.scala.

Also, this method and its helper should probably live in ml/util/ReadWrite.scala since they apply to tuning, Pipeline, and classification (OneVsRest)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, it's an error imported by merging with master. I'll fix it soon.

@jkbradley
Copy link
Member

I'll hold off on a detailed review until these initial items are addressed since they will require significant code movement.

@yinxusen
Copy link
Contributor Author

Sure I'll ping you after that.

Sent from my iPhone

On Mar 23, 2016, at 17:42, jkbradley [email protected] wrote:

I'll hold off on a detailed review until these initial items are addressed since they will require significant code movement.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@SparkQA
Copy link

SparkQA commented Mar 24, 2016

Test build #54086 has finished for PR 9971 at commit ea077d8.

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

@yinxusen
Copy link
Contributor Author

Ping @jkbradley, I've fixed those. You can move on now.

@SparkQA
Copy link

SparkQA commented Mar 24, 2016

Test build #54089 has finished for PR 9971 at commit af0039f.

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

case v: ValidatorParams => Array(v.getEstimator, v.getEvaluator)
case ovr: OneVsRestParams =>
// TODO: SPARK-11892: This case may require special handling.
throw new UnsupportedOperationException("CrossValidator write will fail because it" +
Copy link
Member

Choose a reason for hiding this comment

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

"CrossValidator" --> ${instance.getClass.getName}

@jkbradley
Copy link
Member

Thanks! I just made another pass. I'll check again since this will require a bit more code movement.

@yinxusen
Copy link
Contributor Author

Thanks @jkbradley I moved the validateParams into ValidatorParams, and changed the MetaPipelineReadWrite into an Object.

@SparkQA
Copy link

SparkQA commented Mar 25, 2016

Test build #54220 has finished for PR 9971 at commit 8920986.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class CrossValidatorModelWriter(instance: CrossValidatorModel) extends MLWriter

@SparkQA
Copy link

SparkQA commented Mar 25, 2016

Test build #54225 has finished for PR 9971 at commit 2666913.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class TrainValidationSplitModelWriter(instance: TrainValidationSplitModel) extends MLWriter

@yinxusen
Copy link
Contributor Author

@jkbradley OK for another look

@jkbradley
Copy link
Member

@yinxusen Thanks for the update. It looks good, but there was one missed item + a few more I found. I'm going to send a PR to update this PR.

@jkbradley
Copy link
Member

I just sent a PR: [https://github.com/yinxusen/pull/5]

@yinxusen
Copy link
Contributor Author

Merged! @jkbradley

@yinxusen
Copy link
Contributor Author

test it please

@SparkQA
Copy link

SparkQA commented Mar 28, 2016

Test build #54355 has finished for PR 9971 at commit f9172d1.

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

@jkbradley
Copy link
Member

LGTM
Merging with master
Thanks!

@asfgit asfgit closed this in 8c11d1a Mar 28, 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.

3 participants