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.
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
- Duplicate removal
- Embedded method
- Entity embedding
- Equal-frequency binning
- Equal-width binning
- Feature crossing
- Feature engineering
- Feature extraction
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.