Term 1
- Count in doc 1
- 3
- Documents containing it
- 6 of 6
- Raw tf-idf (default smoothing)
- 3
TF-IDF is a term weighting scheme from information retrieval. See the formula with a worked example, how BM25 differs, and what Google has not said about it.
TF-IDF (term frequency times inverse document frequency) weights a word by how often it appears in a document and how rare it is across a collection. It was developed as a ranking function for search engines and is now also used for classification and clustering. Google's documentation does not name TF-IDF as a ranking system.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
scikit-learn then normalizes the vector by its Euclidean norm. These are scikit-learn's default settings; other tools may use variants, so compare scores only within one tool.
tf-idf(t,d) = tf(t,d) x idf(t)
idf(t) = log((1 + n) / (1 + df(t))) + 1
tf(t,d) = times term t occurs in document d
n = total documents in the set
df(t) = documents that contain term tThe lesson: a word that appears everywhere gets the smallest multiplier, and a rare word that is present in the document gets a bigger one. A word that is absent scores zero however rare it is.
TF-IDF tools used for SEO usually compare the words on your page with words on top-ranking pages. That can show topics a competitor covers and you skip, which is useful for a content gap review. It tells you what other pages say, not what Google rewards.
Elastic's explanation of the BM25 algorithm notes that the IDF formula in BM25 differs from the one in TF/IDF. BM25 also uses a parameter, k1, that determines term frequency saturation: it limits how much a single query term can affect a document's score. Elastic says k1 defaults to 1.2 in Elasticsearch. In scikit-learn's default TF-IDF, the count is multiplied in directly, so a higher count keeps raising the weight.
Both are lexical methods that match on words. Semantic search and embeddings compare meaning instead, and can match a document that shares no words with the query.
4 questions people ask next, answered from the sources on this page.
tf-idf(t,d) = tf(t,d) x idf(t), where tf is how often term t occurs in document d. scikit-learn computes idf(t) as log((1 + n) / (1 + df(t))) + 1 by default.
It is a formula over word counts. scikit-learn calls it a term weighting scheme developed for information retrieval that has also found use in document classification and clustering.
Google's documentation does not say so. Its ranking systems guide does not mention it.
Keyword density looks at one term's share of the words on a page. TF-IDF also weights each term by how common it is across a collection of documents.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.