diff options
author | Yuhao Yang <hhbyyh@gmail.com> | 2015-06-02 23:15:38 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-06-02 23:15:38 -0700 |
commit | 43adbd56114ba80039a23909b0a30d393eaacc62 (patch) | |
tree | 9f0330cd25c9484914a527f53bdb92b7d1698976 /docs/mllib-clustering.md | |
parent | ccaa823290cbe859cd224ac0f7071dfd0218b669 (diff) | |
download | spark-43adbd56114ba80039a23909b0a30d393eaacc62.tar.gz spark-43adbd56114ba80039a23909b0a30d393eaacc62.tar.bz2 spark-43adbd56114ba80039a23909b0a30d393eaacc62.zip |
[SPARK-8043] [MLLIB] [DOC] 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 <hhbyyh@gmail.com>
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
Diffstat (limited to 'docs/mllib-clustering.md')
-rw-r--r-- | docs/mllib-clustering.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/mllib-clustering.md b/docs/mllib-clustering.md index dac22f736e..1b088969dd 100644 --- a/docs/mllib-clustering.md +++ b/docs/mllib-clustering.md @@ -249,11 +249,11 @@ public class GaussianMixtureExample { GaussianMixtureModel gmm = new GaussianMixture().setK(2).run(parsedData.rdd()); // Save and load GaussianMixtureModel - gmm.save(sc, "myGMMModel") - GaussianMixtureModel sameModel = GaussianMixtureModel.load(sc, "myGMMModel") + gmm.save(sc.sc(), "myGMMModel"); + GaussianMixtureModel sameModel = GaussianMixtureModel.load(sc.sc(), "myGMMModel"); // Output the parameters of the mixture model for(int j=0; j<gmm.k(); j++) { - System.out.println("weight=%f\nmu=%s\nsigma=\n%s\n", + System.out.printf("weight=%f\nmu=%s\nsigma=\n%s\n", gmm.weights()[j], gmm.gaussians()[j].mu(), gmm.gaussians()[j].sigma()); } } |