File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
mllib/src/test/scala/org/apache/spark/mllib/feature Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class IDFSuite extends FunSuite with LocalSparkContext {
38
38
val idf = new IDF
39
39
val model = idf.fit(termFrequencies)
40
40
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 ))
42
42
})
43
43
assert(model.idf ~== expected absTol 1e-12 )
44
44
val tfidf = model.transform(termFrequencies).cache().zipWithIndex().map(_.swap).collectAsMap()
@@ -68,7 +68,7 @@ class IDFSuite extends FunSuite with LocalSparkContext {
68
68
val model = idf.fit(termFrequencies)
69
69
val expected = Vectors .dense(Array (0 , 3 , 1 , 2 ).map { x =>
70
70
if (x > 0 ) {
71
- math.log((m.toDouble + 1.0 ) / (x + 1.0 ))
71
+ math.log((m + 1.0 ) / (x + 1.0 ))
72
72
} else {
73
73
0
74
74
}
You can’t perform that action at this time.
0 commit comments