The Dummy Variable Trap

Watching this lecture, I felt like I was seeing a case of the right hand not knowing what the left hand was doing since Hadelin de Ponteves has pointed out the case of needing to transform a "name" or "state" feature using one-hot-encoding with ColumnTransformer. KE is doing the same thing and calling it creation of dummy variables.


Cool stuff - always drop one of the "dummy variables" you generate using one-hot-encoding.

chatG:

Tools like pandas.get_dummies and OneHotEncoder (with drop='first') in sklearn can automatically exclude one dummy variable:

Comments

Popular posts from this blog

Your Handy ML Reference

Efficient Learning Machines: Theories, Concepts, and Applications for Engineers and System Designers