AI engineering glossary · Feature engineering data prep

What is count vectorizer?

Count vectorizer (also called CountVectorizer): A tool that converts a collection of text documents into a matrix of word counts, with rows for documents and columns for vocabulary terms. It is the standard way to build bag-of-words features.

Level: beginnerTopic: Feature engineering data prep

Count vectorizer: an example

Three short SMS messages are turned into a 3 x 20 matrix of counts over a 20-word vocabulary using CountVectorizer.

Related terms

More Feature engineering data prep terms

Where you learn it

Count vectorizer is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.