New factor levels in testing data set not present in training data in h20.randomforest In randomforest classification using h20 package, there are factor levels which are present in testing data but not in training data.There is a warning message in predicting the values of testing data, it says : test/validation dataset column 'x' has levels not trained on. Please help
 A: This is the expected behaviour; if you cannot change your data, then just ignore the warning. (Sorry, I am not aware of any H2O option to suppress the warning.)
The better solution, and their motivation for giving you the warning, is to get better training data, and ensure that it covers all possible values you want to predict. This might mean changing the way you split your training data into train and test (e.g. group by each possible output level, and then randomly split each group 80:20, or whatever, rather than randomly splitting the whole training data 80:20).
An alternative solution is to pre-process the data to replace unusual or rare values. E.g. if you are predicting a person's favourite colour, and you have red, green, blue, yellow, purple, black all well-represented in the training data. But then you have one record each of "mauve" and "light teal". You might be better off converting them to "purple" and "green". The model is not going to learn much from just a single example.
