Repository: spark
Updated Branches:
  refs/heads/branch-2.0 27ed6d5dc -> 6f82d2da3


[SPARKR][MINOR] Fix example of spark.naiveBayes

## What changes were proposed in this pull request?

The original example doesn't work because the features are not categorical. 
This PR fixes this by changing to another dataset.

## How was this patch tested?

Manual test.

Author: Junyang Qian <[email protected]>

Closes #14820 from junyangq/SPARK-FixNaiveBayes.

(cherry picked from commit 18832162357282ec81515b5b2ba93747be3ad18b)
Signed-off-by: Felix Cheung <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6f82d2da
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6f82d2da
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6f82d2da

Branch: refs/heads/branch-2.0
Commit: 6f82d2da382cee2950a0797436e5d48805cbba5f
Parents: 27ed6d5
Author: Junyang Qian <[email protected]>
Authored: Fri Aug 26 11:01:48 2016 -0700
Committer: Felix Cheung <[email protected]>
Committed: Fri Aug 26 11:02:04 2016 -0700

----------------------------------------------------------------------
 R/pkg/R/mllib.R | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6f82d2da/R/pkg/R/mllib.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/mllib.R b/R/pkg/R/mllib.R
index 25dcb3a..b33a16a 100644
--- a/R/pkg/R/mllib.R
+++ b/R/pkg/R/mllib.R
@@ -433,10 +433,11 @@ setMethod("predict", signature(object = "KMeansModel"),
 #' @export
 #' @examples
 #' \dontrun{
-#' df <- createDataFrame(infert)
+#' data <- as.data.frame(UCBAdmissions)
+#' df <- createDataFrame(data)
 #'
 #' # fit a Bernoulli naive Bayes model
-#' model <- spark.naiveBayes(df, education ~ ., smoothing = 0)
+#' model <- spark.naiveBayes(df, Admit ~ Gender + Dept, smoothing = 0)
 #'
 #' # get the summary of the model
 #' summary(model)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to