Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/21393#discussion_r189945560
--- Diff: mllib/src/main/scala/org/apache/spark/ml/fpm/PrefixSpan.scala ---
@@ -35,7 +37,87 @@ import org.apache.spark.sql.types.{ArrayType, LongType,
StructField, StructType}
*/
@Since("2.4.0")
@Experimental
-object PrefixSpan {
+final class PrefixSpan(@Since("2.4.0") override val uid: String) extends
Params {
+
+ @Since("2.4.0")
+ def this() = this(Identifiable.randomUID("prefixSpan"))
+
+ /**
+ * the minimal support level of the sequential pattern, any pattern that
+ * appears more than (minSupport * size-of-the-dataset) times will be
output
+ * (default value: `0.1`).
+ * @group param
+ */
+ @Since("2.4.0")
+ val minSupport = new DoubleParam(this, "minSupport", "the minimal
support level of the " +
+ "sequential pattern, any pattern that appears more than (minSupport *
size-of-the-dataset) " +
+ "times will be output", ParamValidators.gt(0.0))
+
+ /** @group getParam */
+ @Since("2.4.0")
+ def getMinSupport: Double = $(minSupport)
+
+ /**
+ * Set the minSupport parameter.
+ * Default is 1.0.
+ *
+ * @group setParam
+ */
+ @Since("1.3.0")
+ def setMinSupport(value: Double): this.type = set(minSupport, value)
+
+ /**
+ * the maximal length of the sequential pattern
+ * (default value: `10`).
+ * @group param
+ */
+ @Since("2.4.0")
+ val maxPatternLength = new IntParam(this, "maxPatternLength",
+ "the maximal length of the sequential pattern",
+ ParamValidators.gt(0))
+
+ /** @group getParam */
+ @Since("2.4.0")
+ def getMaxPatternLength: Double = $(maxPatternLength)
+
+ /**
+ * Set the maxPatternLength parameter.
+ * Default is 10.
+ *
+ * @group setParam
+ */
+ @Since("2.4.0")
+ def setMaxPatternLength(value: Int): this.type = set(maxPatternLength,
value)
+
+ /**
+ * The maximum number of items (including delimiters used in the
+ * internal storage format) allowed in a projected database before
+ * local processing. If a projected database exceeds this size, another
+ * iteration of distributed prefix growth is run
+ * (default value: `32000000`).
+ * @group param
+ */
+ @Since("2.4.0")
+ val maxLocalProjDBSize = new LongParam(this, "maxLocalProjDBSize",
+ "The maximum number of items (including delimiters used in the
internal storage format) " +
+ "allowed in a projected database before local processing. If a
projected database exceeds " +
+ "this size, another iteration of distributed prefix growth is run",
+ ParamValidators.gt(0))
+
+ /** @group getParam */
+ @Since("2.4.0")
+ def getMaxLocalProjDBSize: Double = $(maxLocalProjDBSize)
--- End diff --
Long
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]