AI engineering glossary · Feature engineering data prep

What is dummy variable trap?

Dummy variable trap: The perfect multicollinearity created when all one-hot columns of a feature are kept in a model with an intercept, because they always sum to 1. It makes coefficients unidentifiable in ordinary linear regression. The fix is to drop one category's column.

Level: intermediateTopic: Feature engineering data prep

Dummy variable trap: an example

Keeping is_male and is_female both plus an intercept lets either column be computed from the other, so regression coefficients cannot be uniquely estimated.

Related terms

More Feature engineering data prep terms

Where you learn it

Dummy variable trap 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.