spark.naiveBayes {SparkR} | R Documentation |
Fit a Bernoulli naive Bayes model on a Spark DataFrame (only categorical data is supported).
spark.naiveBayes(data, formula, ...) ## S4 method for signature 'SparkDataFrame,formula' spark.naiveBayes(data, formula, laplace = 0, ...)
data |
SparkDataFrame for training |
formula |
A symbolic description of the model to be fitted. Currently only a few formula operators are supported, including '~', '.', ':', '+', and '-'. |
laplace |
Smoothing parameter |
a fitted naive Bayes model
e1071: https://cran.r-project.org/web/packages/e1071/
## Not run:
##D df <- createDataFrame(sqlContext, infert)
##D model <- spark.naiveBayes(df, education ~ ., laplace = 0)
## End(Not run)