# How TF is calculated?

Im really confused about how TF is calculated. I understand that TF = count of term x/ total # of terms

For example:

Doc1: This is an example
Doc2: This is another example

TF(this,doc1)= 1/4= 0.25


However, some resources in R and links like this, Consider TF as count of term x; for ex: TF(this,doc1)= 1 then multiply it by IDF.

Is that correct?

• a look at the wikipedia article reveals that both are possible, with different ways to model the term frequency being available. The decision, which one to use, it depending on your application context en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency_2 – deemel Dec 12 '17 at 10:20
• @Rickyfox , but is the recommended one to use is the TF which is the count of the term ? – sara Dec 13 '17 at 4:54
• that's what I was taught in my information retrieval class back then,yes. – deemel Dec 13 '17 at 7:47