Skip to content

Commit

Permalink
Add getters
Browse files Browse the repository at this point in the history
  • Loading branch information
Feynman Liang committed Jul 28, 2015
1 parent 6e149fa commit 01c9ae9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mllib/src/main/scala/org/apache/spark/mllib/fpm/PrefixSpan.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ class PrefixSpan private (
*/
def this() = this(0.1, 10)

/**
* Get the minimal support (i.e. the frequency of occurrence before a pattern is considered
* frequent).
*/
def getMinSupport(): Double = this.minSupport

/**
* Sets the minimal support level (default: `0.1`).
*/
Expand All @@ -63,10 +69,16 @@ class PrefixSpan private (
this
}

/**
* Gets the maximal pattern length (i.e. the length of the longest sequential pattern to consider.
*/
def getMaxPatternLength(): Double = this.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.")
this.maxPatternLength = maxPatternLength
Expand Down

0 comments on commit 01c9ae9

Please sign in to comment.