Github user WeichenXu123 commented on a diff in the pull request:
https://github.com/apache/spark/pull/15051#discussion_r79295910
--- Diff: R/pkg/R/mllib.R ---
@@ -694,8 +694,14 @@ setMethod("predict", signature(object = "KMeansModel"),
#' }
#' @note spark.mlp since 2.1.0
setMethod("spark.mlp", signature(data = "SparkDataFrame"),
- function(data, blockSize = 128, layers = c(3, 5, 2), solver =
"l-bfgs", maxIter = 100,
- tol = 0.5, stepSize = 1, seed = 1) {
+ function(data, layers, blockSize = 128, solver = "l-bfgs",
maxIter = 100,
+ tol = 1E-6, stepSize = 0.03, seed = 0x7FFFFFFF) {
+ if (length(layers) <= 1) {
+ stop("layers vector require length > 0.")
+ }
+ if (any(sapply(layers, function(e) !is.numeric(e)))) {
--- End diff --
layers should be integer, but in R it seems we can't distinguish numeric or
integer vector ?
to `layers<-c(1,2)` or `layers<-c(1.0, 2.0)`, `is.integer(layers[i])` both
return `false` and `as.integer(layers)` both return `true`,
so is there some good way to check it is an integer vector but not a
numeric vector ?
---
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]