Github user yanboliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/16523#discussion_r95369332
--- Diff: R/pkg/R/mllib_clustering.R ---
@@ -204,11 +208,16 @@ setMethod("write.ml", signature(object =
"GaussianMixtureModel", path = "charact
#' @note spark.kmeans since 2.0.0
#' @seealso \link{predict}, \link{read.ml}, \link{write.ml}
setMethod("spark.kmeans", signature(data = "SparkDataFrame", formula =
"formula"),
- function(data, formula, k = 2, maxIter = 20, initMode =
c("k-means||", "random")) {
+ function(data, formula, k = 2, maxIter = 20, initMode =
c("k-means||", "random"),
+ seed = NULL, initSteps = 2, tol = 1E-4) {
formula <- paste(deparse(formula), collapse = "")
initMode <- match.arg(initMode)
+ if (!is.null(seed)) {
+ seed <- as.character(as.integer(seed))
--- End diff --
I'd like to know why you convert ```seed``` to integer first and then
convert to character? AFAIK, the type of ```seed``` in MLlib is ```Long```
whose max value is ```9223372036854775807```. ```as.integer``` will return
```NA``` if it's beyond the scope of integer. Should we support consistent
range for ```seed``` across languages? It looks like R support for ```Long```
is not very well, if we only support integer, do we need to convert the integer
to character?
cc @felixcheung
---
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]