Github user keypointt commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13921#discussion_r68642313
  
    --- Diff: R/pkg/R/mllib.R ---
    @@ -277,14 +277,32 @@ setMethod("summary", signature(object = 
"NaiveBayesModel"),
     #' @param k Number of centers
     #' @param maxIter Maximum iteration number
     #' @param initMode The initialization algorithm choosen to fit the model
    -#' @return A fitted k-means model
    +#' @return \code{spark.kmeans} returns a fitted k-means model
     #' @rdname spark.kmeans
    +#' @name spark.kmeans
     #' @export
     #' @examples
     #' \dontrun{
    -#' model <- spark.kmeans(data, ~ ., k = 4, initMode = "random")
    +#' sparkR.session()
    +#' data(iris)
    +#' df <- createDataFrame(iris)
    +#' model <- spark.kmeans(df, Sepal_Length ~ Sepal_Width, k = 4, initMode = 
"random")
    +#' summary(model)
    +#'
    +#' # fitted values on training data
    +#' fitted <- predict(model, df)
    +#' head(select(fitted, "Sepal_Length", "prediction"))
    +#'
    +#' # save fitted model to input path
    +#' path <- "path/to/model"
    +#' write.ml(model, path)
    --- End diff --
    
    hi @junyangq , isn't it `write.ml (KM)` you are talking about?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to