Skip to content

Commit

Permalink
fix default value, test and order
Browse files Browse the repository at this point in the history
  • Loading branch information
wangmiao1981 committed Feb 15, 2017
1 parent 2e7cec8 commit 9b2147f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions R/pkg/R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -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") })
Expand All @@ -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") })
Expand Down
2 changes: 1 addition & 1 deletion R/pkg/R/mllib_classification.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "") {
Expand Down
2 changes: 1 addition & 1 deletion R/pkg/inst/tests/testthat/test_mllib_classification.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9b2147f

Please sign in to comment.