# Why does TF-IDF use the count of the most common word in the document instead of total count of all words in the document?

From what I understand, the "term frequency" ("TF" in TF-IDF) is calculated from the number of times a certain term occurs in a document vs the most common term in a document:

0.5 * (1 + float64(countOfThisTermInThisDoc) / float64(countOfMostCommonTermInThisDoc))


Why is the number of times the most common word (in the document) used instead of the total number of words?

0.5 * (1 + float64(countOfThisTermInThisDoc) / float64(countOfAllTermsInDoc))

• @roundsquare I think you're mixing the TermFrequency (TF) with the Inverse Document Frequency (IDF). TF is only for a single document. Oct 12 '19 at 16:15
• You are correct! I misread your question. I've deleted my comment - please see Tim's answer, its much better. Oct 12 '19 at 17:22