-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25793][ML]call SaveLoadV2_0.load for classNameV2_0 #22790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,7 +109,7 @@ class BisectingKMeansModel private[clustering] ( | |
|
|
||
| @Since("2.0.0") | ||
| override def save(sc: SparkContext, path: String): Unit = { | ||
| BisectingKMeansModel.SaveLoadV1_0.save(sc, this, path) | ||
| BisectingKMeansModel.SaveLoadV2_0.save(sc, this, path) | ||
| } | ||
|
|
||
| override protected def formatVersion: String = "1.0" | ||
|
|
@@ -126,7 +126,7 @@ object BisectingKMeansModel extends Loader[BisectingKMeansModel] { | |
| val model = SaveLoadV1_0.load(sc, path) | ||
| model | ||
| case (SaveLoadV2_0.thisClassName, SaveLoadV2_0.thisFormatVersion) => | ||
| val model = SaveLoadV1_0.load(sc, path) | ||
| val model = SaveLoadV2_0.load(sc, path) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @mgaido91
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, nice catch!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a regression, but it looks like a correctness or data loss issue at Spark 2.4.0 new feature.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @cloud-fan
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there no test to verify calling correct load method?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can improve the write/load model tests in order to include also a different distance measure from the default one. In this way we should catch this error. Thanks.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have ever use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| model | ||
| case _ => throw new Exception( | ||
| s"BisectingKMeansModel.load did not recognize model with (className, format version):" + | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
formatVersionneeded to change too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say yes, but actually this is never used. I think we can actually remove this from the trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch! need change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the
formatVersionto 2.0. There are quite a few files that implement traitSaveableand haveformatVersion. I don't feel comfortable to change other files for this PR. Maybe I will open a separate jira to removeformatVersionfrom traitSaveable?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree on that, I already have a patch for removing it (moreover this PR can target 2.4, while removal should be done only on master I think). I am submitting it. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created #22830 for that, thanks.