Skip to content
Snippets Groups Projects
Commit 1ed46a60 authored by Xiangrui Meng's avatar Xiangrui Meng
Browse files

[SPARK-7070] [MLLIB] LDA.setBeta should call setTopicConcentration.

jkbradley

Author: Xiangrui Meng <meng@databricks.com>

Closes #5649 from mengxr/SPARK-7070 and squashes the following commits:

c66023c [Xiangrui Meng] setBeta should call setTopicConcentration
parent 6d0749ca
No related branches found
No related tags found
No related merge requests found
...@@ -177,7 +177,7 @@ class LDA private ( ...@@ -177,7 +177,7 @@ class LDA private (
def getBeta: Double = getTopicConcentration def getBeta: Double = getTopicConcentration
/** Alias for [[setTopicConcentration()]] */ /** 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. * Maximum number of iterations for learning.
......
...@@ -123,6 +123,14 @@ class LDASuite extends FunSuite with MLlibTestSparkContext { ...@@ -123,6 +123,14 @@ class LDASuite extends FunSuite with MLlibTestSparkContext {
assert(termVertexIds.map(i => LDA.index2term(i.toLong)) === termIds) assert(termVertexIds.map(i => LDA.index2term(i.toLong)) === termIds)
assert(termVertexIds.forall(i => LDA.isTermVertex((i.toLong, 0)))) 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 { private[clustering] object LDASuite {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment