AI engineering glossary · Feature engineering data prep
What is bag of words?
Bag of words (also called BoW): A text representation that describes a document by how many times each vocabulary word appears, ignoring word order and grammar. It is simple and effective for classification but creates large, sparse vectors and loses context.
Bag of words: an example
With vocabulary [good, bad, movie], the review 'good good movie' becomes [2, 0, 1].
Related terms
More Feature engineering data prep terms
- Binary encoding
- Boruta
- Box-Cox transform
- Categorical variable
- Class imbalance
- Class weights
- Column transformer
- Constant feature
Where you learn it
Bag of words is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.