Skip to content
Quantoros

Does FeatureHasher tokenize raw text documents automatically like HashingVectorizer?

Classic MLLevel: IntermediateHasher input responsibility

Does FeatureHasher tokenize raw text documents automatically like HashingVectorizer?

Hints
  • Separate extracting features from assigning columns.
  • Similar names conceal different input contracts.

Answer

No. FeatureHasher consumes already extracted feature names/values or tokens according to input_type. HashingVectorizer combines text preprocessing and tokenization with hashing.

Source and licence: scikit-learn 1.7.2 — feature extraction · BSD-3-Clause · answer: Quantoros editorial

Related questions