spark.naiveBayes {SparkR}R Documentation

Fit a Bernoulli naive Bayes model

Description

Fit a Bernoulli naive Bayes model on a Spark DataFrame (only categorical data is supported).

Usage

spark.naiveBayes(data, formula, ...)

## S4 method for signature 'SparkDataFrame,formula'
spark.naiveBayes(data, formula,
  laplace = 0, ...)

Arguments

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

Value

a fitted naive Bayes model

See Also

e1071: https://cran.r-project.org/web/packages/e1071/

Examples

## Not run: 
##D df <- createDataFrame(sqlContext, infert)
##D model <- spark.naiveBayes(df, education ~ ., laplace = 0)
## End(Not run)

[Package SparkR version 2.0.0 Index]