Caluculating IDF(Inverse Document Frequency) for document categorization

Viewed 5712

I have doubt in calculating IDF (Inverse Document Frequency) in document categorization. I have more than one category with multiple documents for training. I am calculating IDF for each term in a document using following formula:

IDF(t,D)=log(Total Number documents/Number of Document matching term);

My questions are:

  1. What does "Total Number documents in Corpus" mean? Whether the document count from a current category or from all available categories?
  2. What does "Number of Document matching term" mean? Whether the term matching document count from a current category or from all available categories?
2 Answers
Related