Skip to content

Commit

Permalink
Remove unnecessary else statement
Browse files Browse the repository at this point in the history
  • Loading branch information
rnowling committed Sep 22, 2014
1 parent 4b974f5 commit a200bab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mllib/src/main/scala/org/apache/spark/mllib/feature/IDF.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ private object IDF {
* number of documents, set IDF to 0. This
* will cause multiplication in IDFModel to
* set TF-IDF to 0.
*
* Since arrays are initialized to 0 by default,
* we just omit changing those entries.
*/
if(df(j) >= minimumOccurence) {
inv(j) = math.log((m + 1.0)/ (df(j) + 1.0))
} else {
inv(j) = 0.0
}
j += 1
}
Expand Down

0 comments on commit a200bab

Please sign in to comment.