diff options
author | Yuhao Yang <hhbyyh@gmail.com> | 2016-04-13 13:58:35 -0700 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2016-04-13 13:58:35 -0700 |
commit | 781df499836e4216939e0febdcd5f89d30645759 (patch) | |
tree | f27ffcec85b7e7661eeefd6b02b2e8aa8df01cf5 /docs/ml-classification-regression.md | |
parent | fcdd69260ec75c180f4d727ff2625ca9bf0bdad7 (diff) | |
download | spark-781df499836e4216939e0febdcd5f89d30645759.tar.gz spark-781df499836e4216939e0febdcd5f89d30645759.tar.bz2 spark-781df499836e4216939e0febdcd5f89d30645759.zip |
[SPARK-13089][ML] [Doc] spark.ml Naive Bayes user guide and examples
jira: https://issues.apache.org/jira/browse/SPARK-13089
Add section in ml-classification.md for NaiveBayes DataFrame-based API, plus example code (using include_example to clip code from examples/ folder files).
Author: Yuhao Yang <hhbyyh@gmail.com>
Closes #11015 from hhbyyh/naiveBayesDoc.
Diffstat (limited to 'docs/ml-classification-regression.md')
-rw-r--r-- | docs/ml-classification-regression.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/ml-classification-regression.md b/docs/ml-classification-regression.md index 45155c8ad1..eaf4f6d843 100644 --- a/docs/ml-classification-regression.md +++ b/docs/ml-classification-regression.md @@ -302,6 +302,40 @@ Refer to the [Java API docs](api/java/org/apache/spark/ml/classification/OneVsRe </div> </div> +## Naive Bayes + +[Naive Bayes](http://en.wikipedia.org/wiki/Naive_Bayes_classifier) are a family of simple +probabilistic classifiers based on applying Bayes' theorem with strong (naive) independence +assumptions between the features. The spark.ml implementation currently supports both [multinomial +naive Bayes](http://nlp.stanford.edu/IR-book/html/htmledition/naive-bayes-text-classification-1.html) +and [Bernoulli naive Bayes](http://nlp.stanford.edu/IR-book/html/htmledition/the-bernoulli-model-1.html). +More information can be found in the section on [Naive Bayes in MLlib](mllib-naive-bayes.html#naive-bayes-sparkmllib). + +**Example** + +<div class="codetabs"> +<div data-lang="scala" markdown="1"> + +Refer to the [Scala API docs](api/scala/index.html#org.apache.spark.ml.classification.NaiveBayes) for more details. + +{% include_example scala/org/apache/spark/examples/ml/NaiveBayesExample.scala %} +</div> + +<div data-lang="java" markdown="1"> + +Refer to the [Java API docs](api/java/org/apache/spark/ml/classification/NaiveBayes.html) for more details. + +{% include_example java/org/apache/spark/examples/ml/JavaNaiveBayesExample.java %} +</div> + +<div data-lang="python" markdown="1"> + +Refer to the [Python API docs](api/python/pyspark.ml.html#pyspark.ml.classification.NaiveBayes) for more details. + +{% include_example python/ml/naive_bayes_example.py %} +</div> +</div> + # Regression |