Skip to content

Commit cb463b6

Browse files
felixcheungshivaram
authored andcommitted
[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. (cherry picked from commit 7f38b9d) Signed-off-by: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
1 parent b938ca7 commit cb463b6

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

R/pkg/R/generics.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,6 @@ setGeneric("spark.glm", function(data, formula, ...) { standardGeneric("spark.gl
12551255
#' @export
12561256
setGeneric("glm")
12571257

1258-
#' predict
12591258
#' @rdname predict
12601259
#' @export
12611260
setGeneric("predict", function(object, ...) { standardGeneric("predict") })
@@ -1280,7 +1279,6 @@ setGeneric("spark.naiveBayes", function(data, formula, ...) { standardGeneric("s
12801279
#' @export
12811280
setGeneric("spark.survreg", function(data, formula, ...) { standardGeneric("spark.survreg") })
12821281

1283-
#' write.ml
12841282
#' @rdname write.ml
12851283
#' @export
12861284
setGeneric("write.ml", function(object, path, ...) { standardGeneric("write.ml") })

R/pkg/R/mllib.R

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ setClass("AFTSurvivalRegressionModel", representation(jobj = "jobj"))
5353
#' @note KMeansModel since 2.0.0
5454
setClass("KMeansModel", representation(jobj = "jobj"))
5555

56+
#' Saves the MLlib model to the input path
57+
#'
58+
#' Saves the MLlib model to the input path. For more information, see the specific
59+
#' MLlib model below.
60+
#' @rdname write.ml
61+
#' @name write.ml
62+
#' @export
63+
#' @seealso \link{spark.glm}, \link{glm}
64+
#' @seealso \link{spark.kmeans}, \link{spark.naiveBayes}, \link{spark.survreg}
65+
#' @seealso \link{read.ml}
66+
NULL
67+
68+
#' Makes predictions from a MLlib model
69+
#'
70+
#' Makes predictions from a MLlib model. For more information, see the specific
71+
#' MLlib model below.
72+
#' @rdname predict
73+
#' @name predict
74+
#' @export
75+
#' @seealso \link{spark.glm}, \link{glm}
76+
#' @seealso \link{spark.kmeans}, \link{spark.naiveBayes}, \link{spark.survreg}
77+
NULL
78+
5679
#' Generalized Linear Models
5780
#'
5881
#' Fits generalized linear model against a Spark DataFrame.
@@ -146,7 +169,7 @@ setMethod("glm", signature(formula = "formula", family = "ANY", data = "SparkDat
146169
})
147170

148171
# Returns the summary of a model produced by glm() or spark.glm(), similarly to R's summary().
149-
#'
172+
150173
#' @param object A fitted generalized linear model
151174
#' @return \code{summary} returns a summary object of the fitted model, a list of components
152175
#' including at least the coefficients, null/residual deviance, null/residual degrees
@@ -186,7 +209,7 @@ setMethod("summary", signature(object = "GeneralizedLinearRegressionModel"),
186209
})
187210

188211
# Prints the summary of GeneralizedLinearRegressionModel
189-
#'
212+
190213
#' @rdname spark.glm
191214
#' @param x Summary object of fitted generalized linear model returned by \code{summary} function
192215
#' @export
@@ -345,7 +368,7 @@ setMethod("fitted", signature(object = "KMeansModel"),
345368
})
346369

347370
# Get the summary of a k-means model
348-
#'
371+
349372
#' @param object A fitted k-means model
350373
#' @return \code{summary} returns the model's coefficients, size and cluster
351374
#' @rdname spark.kmeans
@@ -372,7 +395,7 @@ setMethod("summary", signature(object = "KMeansModel"),
372395
})
373396

374397
# Predicted values based on a k-means model
375-
#'
398+
376399
#' @return \code{predict} returns the predicted values based on a k-means model
377400
#' @rdname spark.kmeans
378401
#' @export
@@ -465,7 +488,7 @@ setMethod("write.ml", signature(object = "AFTSurvivalRegressionModel", path = "c
465488
})
466489

467490
# Saves the generalized linear model to the input path.
468-
#'
491+
469492
#' @param path The directory where the model is saved
470493
#' @param overwrite Overwrites or not if the output path already exists. Default is FALSE
471494
#' which means throw exception if the output path exists.
@@ -483,7 +506,7 @@ setMethod("write.ml", signature(object = "GeneralizedLinearRegressionModel", pat
483506
})
484507

485508
# Save fitted MLlib model to the input path
486-
#'
509+
487510
#' @param path The directory where the model is saved
488511
#' @param overwrite Overwrites or not if the output path already exists. Default is FALSE
489512
#' which means throw exception if the output path exists.
@@ -508,6 +531,7 @@ setMethod("write.ml", signature(object = "KMeansModel", path = "character"),
508531
#' @rdname read.ml
509532
#' @name read.ml
510533
#' @export
534+
#' @seealso \link{write.ml}
511535
#' @examples
512536
#' \dontrun{
513537
#' path <- "path/to/model"

0 commit comments

Comments
 (0)