Additional factor level in test data which causes no prediction


How to handle a categorical variable having 3 levels in training data but with 4 levels in test data while predicting?
This is giving error while predicting…

Please advise.


Hi @manalykum.

If you are using R, simply add the 4th level to the training set manually using:


1 Like