From eb8dd68132998aa00902dfeb935db1358781e1c1 Mon Sep 17 00:00:00 2001 From: Yanbo Liang Date: Mon, 5 Dec 2016 00:39:44 -0800 Subject: [SPARK-18279][DOC][ML][SPARKR] Add R examples to ML programming guide. ## What changes were proposed in this pull request? Add R examples to ML programming guide for the following algorithms as POC: * spark.glm * spark.survreg * spark.naiveBayes * spark.kmeans The four algorithms were added to SparkR since 2.0.0, more docs for algorithms added during 2.1 release cycle will be addressed in a separate follow-up PR. ## How was this patch tested? This is the screenshots of generated ML programming guide for ```GeneralizedLinearRegression```: ![image](https://cloud.githubusercontent.com/assets/1962026/20866403/babad856-b9e1-11e6-9984-62747801e8c4.png) Author: Yanbo Liang Closes #16136 from yanboliang/spark-18279. --- docs/ml-classification-regression.md | 22 ++++++++++++++++++++++ docs/ml-clustering.md | 8 ++++++++ 2 files changed, 30 insertions(+) diff --git a/docs/ml-classification-regression.md b/docs/ml-classification-regression.md index 43cc79b9c0..575959307a 100644 --- a/docs/ml-classification-regression.md +++ b/docs/ml-classification-regression.md @@ -389,6 +389,14 @@ Refer to the [Python API docs](api/python/pyspark.ml.html#pyspark.ml.classificat {% include_example python/ml/naive_bayes_example.py %} + +
+ +Refer to the [R API docs](api/R/spark.naiveBayes.html) for more details. + +{% include_example naiveBayes r/ml.R %} +
+ @@ -566,6 +574,13 @@ Refer to the [Python API docs](api/python/pyspark.ml.html#pyspark.ml.regression. {% include_example python/ml/generalized_linear_regression_example.py %} +
+ +Refer to the [R API docs](api/R/spark.glm.html) for more details. + +{% include_example glm r/ml.R %} +
+ @@ -755,6 +770,13 @@ Refer to the [Python API docs](api/python/pyspark.ml.html#pyspark.ml.regression. {% include_example python/ml/aft_survival_regression.py %} +
+ +Refer to the [R API docs](api/R/spark.survreg.html) for more details. + +{% include_example survreg r/ml.R %} +
+ diff --git a/docs/ml-clustering.md b/docs/ml-clustering.md index eedacb12bc..da23442555 100644 --- a/docs/ml-clustering.md +++ b/docs/ml-clustering.md @@ -86,6 +86,14 @@ Refer to the [Python API docs](api/python/pyspark.ml.html#pyspark.ml.clustering. {% include_example python/ml/kmeans_example.py %} + +
+ +Refer to the [R API docs](api/R/spark.kmeans.html) for more details. + +{% include_example kmeans r/ml.R %} +
+ ## Latent Dirichlet allocation (LDA) -- cgit v1.2.3