Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/7937#discussion_r36244013
--- Diff: mllib/src/main/scala/org/apache/spark/mllib/fpm/PrefixSpan.scala
---
@@ -83,45 +82,109 @@ class PrefixSpan private (
/**
* Gets the maximal pattern length (i.e. the length of the longest
sequential pattern to consider.
*/
- def getMaxPatternLength: Double = this.maxPatternLength
+ def getMaxPatternLength: Double = maxPatternLength
/**
* Sets maximal pattern length (default: `10`).
*/
def setMaxPatternLength(maxPatternLength: Int): this.type = {
// TODO: support unbounded pattern length when maxPatternLength = 0
- require(maxPatternLength >= 1, "The maximum pattern length value must
be greater than 0.")
+ require(maxPatternLength >= 1,
+ s"The maximum pattern length value must be greater than 0, but got
$maxPatternLength.")
this.maxPatternLength = maxPatternLength
this
}
/**
- * Find the complete set of sequential patterns in the input sequences
of itemsets.
- * @param data ordered sequences of itemsets.
- * @return a [[PrefixSpanModel]] that contains the frequent sequences
+ * Gets the maximum number of items allowed in a projected database
before local processing.
+ */
+ def getMaxLocalProjDBSize: Long = maxLocalProjDBSize
+
+ /**
+ * Sets the maximum number of items allowed in a projected database
before local processing
+ * (default: `32000000L`).
+ */
+ def setMaxLocalProjDBSize(maxLocalProjDBSize: Long): this.type = {
+ require(maxLocalProjDBSize >= 0L,
--- End diff --
I use `0L` to provide a way to disable local processing. Then this
algorithm becomes Apriori-like.
---
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]