{
  "name": "Inverse document frequency (idf) by document frequency in a four-document corpus: smoothed vs unsmoothed",
  "description": "Computed from the two idf formulas in the scikit-learn text feature extraction guide for a corpus of n = 4 documents, showing how the weight of a term falls as it appears in more documents. Values rounded to four decimals.",
  "page": "https://casrai.org/guides/text-mining",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-24T17:20:00Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Document frequency case",
      "unit": "",
      "description": ""
    },
    {
      "name": "df(t)",
      "unit": "documents",
      "description": ""
    },
    {
      "name": "idf smoothed (smooth_idf=True)",
      "unit": "",
      "description": "ln((1+n)/(1+df))+1"
    },
    {
      "name": "idf unsmoothed (smooth_idf=False)",
      "unit": "",
      "description": "ln(n/df)+1"
    }
  ],
  "rows": [
    {
      "Document frequency case": "Term appears in 1 of 4 documents",
      "df(t)": 1,
      "idf smoothed (smooth_idf=True)": 1.9163,
      "idf unsmoothed (smooth_idf=False)": 2.3863
    },
    {
      "Document frequency case": "Term appears in 2 of 4 documents",
      "df(t)": 2,
      "idf smoothed (smooth_idf=True)": 1.5108,
      "idf unsmoothed (smooth_idf=False)": 1.6931
    },
    {
      "Document frequency case": "Term appears in 3 of 4 documents",
      "df(t)": 3,
      "idf smoothed (smooth_idf=True)": 1.2231,
      "idf unsmoothed (smooth_idf=False)": 1.2877
    },
    {
      "Document frequency case": "Term appears in 4 of 4 documents",
      "df(t)": 4,
      "idf smoothed (smooth_idf=True)": 1,
      "idf unsmoothed (smooth_idf=False)": 1
    }
  ],
  "sources": [
    {
      "title": "scikit-learn user guide: Text feature extraction",
      "url": "https://scikit-learn.org/stable/modules/feature_extraction.html",
      "accessed": "2026-11-14"
    }
  ]
}