diff --git a/R/pkg/R/generics.R b/R/pkg/R/generics.R index de1c10b8e65ba..0d9a9968e2855 100644 --- a/R/pkg/R/generics.R +++ b/R/pkg/R/generics.R @@ -1380,10 +1380,6 @@ setGeneric("spark.kstest", function(data, ...) { standardGeneric("spark.kstest") #' @export setGeneric("spark.lda", function(data, ...) { standardGeneric("spark.lda") }) -#' @rdname spark.svmLinear -#' @export -setGeneric("spark.svmLinear", function(data, formula, ...) { standardGeneric("spark.svmLinear") }) - #' @rdname spark.logit #' @export setGeneric("spark.logit", function(data, formula, ...) { standardGeneric("spark.logit") }) @@ -1405,6 +1401,10 @@ setGeneric("spark.randomForest", #' @export setGeneric("spark.survreg", function(data, formula) { standardGeneric("spark.survreg") }) +#' @rdname spark.svmLinear +#' @export +setGeneric("spark.svmLinear", function(data, formula, ...) { standardGeneric("spark.svmLinear") }) + #' @rdname spark.lda #' @export setGeneric("spark.posterior", function(object, newData) { standardGeneric("spark.posterior") }) diff --git a/R/pkg/R/mllib_classification.R b/R/pkg/R/mllib_classification.R index 4e623984ac36a..fa0d795faa10f 100644 --- a/R/pkg/R/mllib_classification.R +++ b/R/pkg/R/mllib_classification.R @@ -95,7 +95,7 @@ setClass("NaiveBayesModel", representation(jobj = "jobj")) #' @note spark.svmLinear since 2.2.0 setMethod("spark.svmLinear", signature(data = "SparkDataFrame", formula = "formula"), function(data, formula, regParam = 0.0, maxIter = 100, tol = 1E-6, standardization = TRUE, - threshold = 0.5, weightCol = NULL, aggregationDepth = 2) { + threshold = 0.0, weightCol = NULL, aggregationDepth = 2) { formula <- paste(deparse(formula), collapse = "") if (!is.null(weightCol) && weightCol == "") { diff --git a/R/pkg/inst/tests/testthat/test_mllib_classification.R b/R/pkg/inst/tests/testthat/test_mllib_classification.R index d571be8f72ed6..620f528f2e6c8 100644 --- a/R/pkg/inst/tests/testthat/test_mllib_classification.R +++ b/R/pkg/inst/tests/testthat/test_mllib_classification.R @@ -30,7 +30,7 @@ absoluteSparkPath <- function(x) { test_that("spark.svmLinear", { df <- suppressWarnings(createDataFrame(iris)) training <- df[df$Species %in% c("versicolor", "virginica"), ] - model <- model <- spark.svmLinear(training, Species ~ ., regParam = 0.01, maxIter = 10) + model <- spark.svmLinear(training, Species ~ ., regParam = 0.01, maxIter = 10) summary <- summary(model) # test summary coefficients return matrix type