Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class LDA private (
def getBeta: Double = getTopicConcentration

/** Alias for [[setTopicConcentration()]] */
def setBeta(beta: Double): this.type = setBeta(beta)
def setBeta(beta: Double): this.type = setTopicConcentration(beta)

/**
* Maximum number of iterations for learning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ class LDASuite extends FunSuite with MLlibTestSparkContext {
assert(termVertexIds.map(i => LDA.index2term(i.toLong)) === termIds)
assert(termVertexIds.forall(i => LDA.isTermVertex((i.toLong, 0))))
}

test("setter alias") {
val lda = new LDA().setAlpha(2.0).setBeta(3.0)
assert(lda.getAlpha === 2.0)
assert(lda.getDocConcentration === 2.0)
assert(lda.getBeta === 3.0)
assert(lda.getTopicConcentration === 3.0)
}
}

private[clustering] object LDASuite {
Expand Down