Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Stop if numPartitions is not null and not strictly positive
  • Loading branch information
zero323 committed Mar 27, 2017
commit 254e8a41fdeaff12d46f84be438caf3220827f69
5 changes: 4 additions & 1 deletion R/pkg/R/mllib_fpm.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ setMethod("spark.fpGrowth", signature(data = "SparkDataFrame"),
if (!is.numeric(minConfidence) || minConfidence < 0 || minConfidence > 1) {
stop("minConfidence should be a number [0, 1].")
}
if (!is.null(numPartitions)) {
numPartitions <- as.integer(numPartitions)
stopifnot(numPartitions > 0)
}

numPartitions <- if (is.null(numPartitions)) NULL else as.integer(numPartitions)
jobj <- callJStatic("org.apache.spark.ml.r.FPGrowthWrapper", "fit",
data@sdf, as.numeric(minSupport), as.numeric(minConfidence),
itemsCol, numPartitions)
Expand Down