We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b974f5 commit a200babCopy full SHA for a200bab
mllib/src/main/scala/org/apache/spark/mllib/feature/IDF.scala
@@ -139,11 +139,12 @@ private object IDF {
139
* number of documents, set IDF to 0. This
140
* will cause multiplication in IDFModel to
141
* set TF-IDF to 0.
142
+ *
143
+ * Since arrays are initialized to 0 by default,
144
+ * we just omit changing those entries.
145
*/
146
if(df(j) >= minimumOccurence) {
147
inv(j) = math.log((m + 1.0)/ (df(j) + 1.0))
- } else {
- inv(j) = 0.0
148
}
149
j += 1
150
0 commit comments