-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
[Spark-8043][MLlib][Doc] update NaiveBayes and SVM examples in doc #6584
Conversation
Test build #33982 has finished for PR 6584 at commit
|
@@ -282,8 +277,8 @@ public class SVMClassifier { | |||
System.out.println("Area under ROC = " + auROC); | |||
|
|||
// Save and load model | |||
model.save(sc.sc(), "myModelPath"); | |||
SVMModel sameModel = SVMModel.load(sc.sc(), "myModelPath"); | |||
model.save(sc, "myModelPath"); |
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 think sc.sc()
is required because save
expects a SparkContext
instead of JavaSparkContext
. Though we should really overload it with JavaSparkContext
.
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.
Hi Xiangrui, the sc here seems to be an instance of SparkContext (refer to line 251). And the original code has compile error.
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, I see. We only use it in loadLibSVMFile
. Thanks for catching this!
Test build #34051 has finished for PR 6584 at commit
|
jira: https://issues.apache.org/jira/browse/SPARK-8043 I found some issues during testing the save/load examples in markdown Documents, as a part of 1.4 QA plan Author: Yuhao Yang <[email protected]> Closes #6584 from hhbyyh/naiveDocExample and squashes the following commits: a01a206 [Yuhao Yang] fix for Gaussian mixture 2fb8b96 [Yuhao Yang] update NaiveBayes and SVM examples in doc (cherry picked from commit 43adbd5) Signed-off-by: Xiangrui Meng <[email protected]>
LGTM. Merged into master and branch-1.4. Thanks! |
jira: https://issues.apache.org/jira/browse/SPARK-8043 I found some issues during testing the save/load examples in markdown Documents, as a part of 1.4 QA plan Author: Yuhao Yang <[email protected]> Closes apache#6584 from hhbyyh/naiveDocExample and squashes the following commits: a01a206 [Yuhao Yang] fix for Gaussian mixture 2fb8b96 [Yuhao Yang] update NaiveBayes and SVM examples in doc
jira: https://issues.apache.org/jira/browse/SPARK-8043 I found some issues during testing the save/load examples in markdown Documents, as a part of 1.4 QA plan Author: Yuhao Yang <[email protected]> Closes apache#6584 from hhbyyh/naiveDocExample and squashes the following commits: a01a206 [Yuhao Yang] fix for Gaussian mixture 2fb8b96 [Yuhao Yang] update NaiveBayes and SVM examples in doc
jira: https://issues.apache.org/jira/browse/SPARK-8043
I found some issues during testing the save/load examples in markdown Documents, as a part of 1.4 QA plan