{
  "name": "Effect of CountVectorizer settings on feature count (four-sentence example corpus)",
  "description": "Number of vocabulary features CountVectorizer produces on a four-sentence illustrative corpus under different settings. Compiled by running scikit-learn 1.9.1 on the corpus shown in the guide; setting semantics come from the scikit-learn CountVectorizer API reference and user guide.",
  "page": "https://casrai.org/guides/countvectorizer-sklearn",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-16T21:51:34Z",
  "temporalCoverage": "scikit-learn 1.9.1, run 2026-11-16",
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Setting",
      "unit": "",
      "description": ""
    },
    {
      "name": "Features",
      "unit": "count",
      "description": "Vocabulary size on the example corpus"
    },
    {
      "name": "What changed",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Setting": "Defaults",
      "Features": 18,
      "What changed": "Baseline: 2+ letter tokens, lowercase, unigrams"
    },
    {
      "Setting": "token_pattern=r'\\b\\w+\\b'",
      "Features": 19,
      "What changed": "Adds the single-letter token 'a'"
    },
    {
      "Setting": "stop_words='english'",
      "Features": 14,
      "What changed": "Removes the, was, were, with"
    },
    {
      "Setting": "ngram_range=(1, 2)",
      "Features": 37,
      "What changed": "Unigrams plus adjacent word pairs"
    },
    {
      "Setting": "ngram_range=(2, 2)",
      "Features": 19,
      "What changed": "Adjacent word pairs only"
    },
    {
      "Setting": "min_df=2",
      "Features": 7,
      "What changed": "Keeps tokens in at least two documents"
    },
    {
      "Setting": "binary=True",
      "Features": 18,
      "What changed": "Same vocabulary; counts capped at 1"
    }
  ],
  "sources": [
    {
      "title": "scikit-learn: CountVectorizer API reference",
      "url": "https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.CountVectorizer.html",
      "accessed": "2026-11-16"
    },
    {
      "title": "scikit-learn user guide: text feature extraction",
      "url": "https://scikit-learn.org/stable/modules/feature_extraction.html",
      "accessed": "2026-11-16"
    }
  ]
}