TF-IDF
TF-IDF, per its namesake, is comprised of two statistics: term frequency (TF) and inverse document frequency (IDF).
The central thesis to TF is that if a word (called a term) occurs many times in a document, it means that the document revolves more around that word. It makes sense; look at your emails. The keywords typically revolve around a central topic. But TF is a lot more simplistic than that. There is no notion of topics. It's just a count of how many times a word happens in a document.
IDF, on the other hand, is a statistic that determines how important a term is to a document. In the examples we've seen, do note that the word Subject, with a capital S occurs once in both types of documents: spam and ham. In broad strokes, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access