Skip to content

Commit e6523a8

Browse files
committed
Remove unnecessary toDouble's from IDFSuite
1 parent bfa82ec commit e6523a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mllib/src/test/scala/org/apache/spark/mllib/feature/IDFSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class IDFSuite extends FunSuite with LocalSparkContext {
3838
val idf = new IDF
3939
val model = idf.fit(termFrequencies)
4040
val expected = Vectors.dense(Array(0, 3, 1, 2).map { x =>
41-
math.log((m.toDouble + 1.0) / (x + 1.0))
41+
math.log((m + 1.0) / (x + 1.0))
4242
})
4343
assert(model.idf ~== expected absTol 1e-12)
4444
val tfidf = model.transform(termFrequencies).cache().zipWithIndex().map(_.swap).collectAsMap()
@@ -68,7 +68,7 @@ class IDFSuite extends FunSuite with LocalSparkContext {
6868
val model = idf.fit(termFrequencies)
6969
val expected = Vectors.dense(Array(0, 3, 1, 2).map { x =>
7070
if (x > 0) {
71-
math.log((m.toDouble + 1.0) / (x + 1.0))
71+
math.log((m + 1.0) / (x + 1.0))
7272
} else {
7373
0
7474
}

0 commit comments

Comments
 (0)