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:
- What does "Total Number documents in Corpus" mean? Whether the document count from a current category or from all available categories?
- What does "Number of Document matching term" mean? Whether the term matching document count from a current category or from all available categories?