aboutsummaryrefslogtreecommitdiff
path: root/R/pkg
diff options
context:
space:
mode:
authorFelix Cheung <felixcheung_m@hotmail.com>2016-07-11 14:34:48 -0700
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2016-07-11 14:34:48 -0700
commit7f38b9d5f469b2550bc481cbf9adb9acc3779712 (patch)
treeb6bbee81cfc88046265a3f15a7cc338e0d66a79b /R/pkg
parent2ad031be67c7a0f0c4895c084c891330a9ec935e (diff)
downloadspark-7f38b9d5f469b2550bc481cbf9adb9acc3779712.tar.gz
spark-7f38b9d5f469b2550bc481cbf9adb9acc3779712.tar.bz2
spark-7f38b9d5f469b2550bc481cbf9adb9acc3779712.zip
[SPARK-16144][SPARKR] update R API doc for mllib
## What changes were proposed in this pull request? From SPARK-16140/PR #13921 - the issue is we left write.ml doc empty: ![image](https://cloud.githubusercontent.com/assets/8969467/16481934/856dd0ea-3e62-11e6-9474-e4d57d1ca001.png) Here's what I meant as the fix: ![image](https://cloud.githubusercontent.com/assets/8969467/16481943/911f02ec-3e62-11e6-9d68-17363a9f5628.png) ![image](https://cloud.githubusercontent.com/assets/8969467/16481950/9bc057aa-3e62-11e6-8127-54870701c4b1.png) I didn't realize there was already a JIRA on this. mengxr yanboliang ## How was this patch tested? check doc generated. Author: Felix Cheung <felixcheung_m@hotmail.com> Closes #13993 from felixcheung/rmllibdoc.
Diffstat (limited to 'R/pkg')
-rw-r--r--R/pkg/R/generics.R2
-rw-r--r--R/pkg/R/mllib.R36
2 files changed, 30 insertions, 8 deletions
diff --git a/R/pkg/R/generics.R b/R/pkg/R/generics.R
index e4ec508795..df057bda99 100644
--- a/R/pkg/R/generics.R
+++ b/R/pkg/R/generics.R
@@ -1255,7 +1255,6 @@ setGeneric("spark.glm", function(data, formula, ...) { standardGeneric("spark.gl
#' @export
setGeneric("glm")
-#' predict
#' @rdname predict
#' @export
setGeneric("predict", function(object, ...) { standardGeneric("predict") })
@@ -1280,7 +1279,6 @@ setGeneric("spark.naiveBayes", function(data, formula, ...) { standardGeneric("s
#' @export
setGeneric("spark.survreg", function(data, formula, ...) { standardGeneric("spark.survreg") })
-#' write.ml
#' @rdname write.ml
#' @export
setGeneric("write.ml", function(object, path, ...) { standardGeneric("write.ml") })
diff --git a/R/pkg/R/mllib.R b/R/pkg/R/mllib.R
index e9fd0c75c1..94e1f654f5 100644
--- a/R/pkg/R/mllib.R
+++ b/R/pkg/R/mllib.R
@@ -53,6 +53,29 @@ setClass("AFTSurvivalRegressionModel", representation(jobj = "jobj"))
#' @note KMeansModel since 2.0.0
setClass("KMeansModel", representation(jobj = "jobj"))
+#' Saves the MLlib model to the input path
+#'
+#' Saves the MLlib model to the input path. For more information, see the specific
+#' MLlib model below.
+#' @rdname write.ml
+#' @name write.ml
+#' @export
+#' @seealso \link{spark.glm}, \link{glm}
+#' @seealso \link{spark.kmeans}, \link{spark.naiveBayes}, \link{spark.survreg}
+#' @seealso \link{read.ml}
+NULL
+
+#' Makes predictions from a MLlib model
+#'
+#' Makes predictions from a MLlib model. For more information, see the specific
+#' MLlib model below.
+#' @rdname predict
+#' @name predict
+#' @export
+#' @seealso \link{spark.glm}, \link{glm}
+#' @seealso \link{spark.kmeans}, \link{spark.naiveBayes}, \link{spark.survreg}
+NULL
+
#' Generalized Linear Models
#'
#' Fits generalized linear model against a Spark DataFrame.
@@ -146,7 +169,7 @@ setMethod("glm", signature(formula = "formula", family = "ANY", data = "SparkDat
})
# Returns the summary of a model produced by glm() or spark.glm(), similarly to R's summary().
-#'
+
#' @param object A fitted generalized linear model
#' @return \code{summary} returns a summary object of the fitted model, a list of components
#' including at least the coefficients, null/residual deviance, null/residual degrees
@@ -186,7 +209,7 @@ setMethod("summary", signature(object = "GeneralizedLinearRegressionModel"),
})
# Prints the summary of GeneralizedLinearRegressionModel
-#'
+
#' @rdname spark.glm
#' @param x Summary object of fitted generalized linear model returned by \code{summary} function
#' @export
@@ -345,7 +368,7 @@ setMethod("fitted", signature(object = "KMeansModel"),
})
# Get the summary of a k-means model
-#'
+
#' @param object A fitted k-means model
#' @return \code{summary} returns the model's coefficients, size and cluster
#' @rdname spark.kmeans
@@ -372,7 +395,7 @@ setMethod("summary", signature(object = "KMeansModel"),
})
# Predicted values based on a k-means model
-#'
+
#' @return \code{predict} returns the predicted values based on a k-means model
#' @rdname spark.kmeans
#' @export
@@ -465,7 +488,7 @@ setMethod("write.ml", signature(object = "AFTSurvivalRegressionModel", path = "c
})
# Saves the generalized linear model to the input path.
-#'
+
#' @param path The directory where the model is saved
#' @param overwrite Overwrites or not if the output path already exists. Default is FALSE
#' which means throw exception if the output path exists.
@@ -483,7 +506,7 @@ setMethod("write.ml", signature(object = "GeneralizedLinearRegressionModel", pat
})
# Save fitted MLlib model to the input path
-#'
+
#' @param path The directory where the model is saved
#' @param overwrite Overwrites or not if the output path already exists. Default is FALSE
#' which means throw exception if the output path exists.
@@ -508,6 +531,7 @@ setMethod("write.ml", signature(object = "KMeansModel", path = "character"),
#' @rdname read.ml
#' @name read.ml
#' @export
+#' @seealso \link{write.ml}
#' @examples
#' \dontrun{
#' path <- "path/to/model"