The dummy variable trap occurs when the dummy variables generated are having multicollinearity and are used for training the model.