05 Apr A hands-on guide to dummy variable trap with a solution in Python Sourabh Mehta categorical labels The dummy variable trap occurs when the dummy variables generated are having multicollinearity and are used for training the model.