Skip to content

Commit 01c9ae9

Browse files
author
Feynman Liang
committed
Add getters
1 parent 6e149fa commit 01c9ae9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mllib/src/main/scala/org/apache/spark/mllib/fpm/PrefixSpan.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ class PrefixSpan private (
5353
*/
5454
def this() = this(0.1, 10)
5555

56+
/**
57+
* Get the minimal support (i.e. the frequency of occurrence before a pattern is considered
58+
* frequent).
59+
*/
60+
def getMinSupport(): Double = this.minSupport
61+
5662
/**
5763
* Sets the minimal support level (default: `0.1`).
5864
*/
@@ -63,10 +69,16 @@ class PrefixSpan private (
6369
this
6470
}
6571

72+
/**
73+
* Gets the maximal pattern length (i.e. the length of the longest sequential pattern to consider.
74+
*/
75+
def getMaxPatternLength(): Double = this.maxPatternLength
76+
6677
/**
6778
* Sets maximal pattern length (default: `10`).
6879
*/
6980
def setMaxPatternLength(maxPatternLength: Int): this.type = {
81+
// TODO: support unbounded pattern length when maxPatternLength = 0
7082
require(maxPatternLength >= 1,
7183
"The maximum pattern length value must be greater than 0.")
7284
this.maxPatternLength = maxPatternLength

0 commit comments

Comments
 (0)