Github user junyangq commented on a diff in the pull request: https://github.com/apache/spark/pull/14980#discussion_r78679227 --- Diff: R/pkg/vignettes/sparkr-vignettes.Rmd --- @@ -385,22 +385,29 @@ head(result[order(result$max_mpg, decreasing = TRUE), ]) Similar to `lapply` in native R, `spark.lapply` runs a function over a list of elements and distributes the computations with Spark. `spark.lapply` works in a manner that is similar to `doParallel` or `lapply` to elements of a list. The results of all the computations should fit in a single machine. If that is not the case you can do something like `df <- createDataFrame(list)` and then use `dapply`. +We use `svm` in package `e1071` as an example. We use all default settings except for varying costs of constraints violation. `spark.lapply` can train those different models in parallel. + ```{r} -families <- c("gaussian", "poisson") -train <- function(family) { - model <- glm(mpg ~ hp, mtcars, family = family) +costs <- exp(seq(from = log(1), to = log(1000), length.out = 5)) --- End diff -- It runs as long as `e1071` is installed in the workers. Perhaps it's better to add a check there?
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org