diff options
author | Junyang Qian <junyangq@databricks.com> | 2016-08-26 11:01:48 -0700 |
---|---|---|
committer | Felix Cheung <felixcheung@apache.org> | 2016-08-26 11:01:48 -0700 |
commit | 18832162357282ec81515b5b2ba93747be3ad18b (patch) | |
tree | b3ce78abf70e72beebde95d5fedd7eb723567c4a /R/pkg | |
parent | 970ab8f6ddc66401ad1cf4b2d1050dd0c8876224 (diff) | |
download | spark-18832162357282ec81515b5b2ba93747be3ad18b.tar.gz spark-18832162357282ec81515b5b2ba93747be3ad18b.tar.bz2 spark-18832162357282ec81515b5b2ba93747be3ad18b.zip |
[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 <junyangq@databricks.com>
Closes #14820 from junyangq/SPARK-FixNaiveBayes.
Diffstat (limited to 'R/pkg')
-rw-r--r-- | R/pkg/R/mllib.R | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/R/pkg/R/mllib.R b/R/pkg/R/mllib.R index dfc5a1c7df..6808aaea8c 100644 --- a/R/pkg/R/mllib.R +++ b/R/pkg/R/mllib.R @@ -747,10 +747,11 @@ setMethod("summary", signature(object = "MultilayerPerceptronClassificationModel #' @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) |