8
votes

I have trained and saved my H2O AutoML model. after reloading, while I am using predict method, I am getting below error: java.lang.IllegalArgumentException: Test/Validation dataset has a non-categorical column 'response' which is categorical in the training data

I have not specified any encoding while model creation but I am getting this error now. Can anyone help me on this issue.

Any help will be highly appreciated.

1
Can you specify which version of H2O you are using? This looks like an old bug that was fixed.Erin LeDell
I am using 3.26.0.2 version of H2O.ATUL AGARWAL
I am seeing a similar error on 3.26.0.3 java.lang.IllegalArgumentException: Test/Validation dataset has a categorical response column 'C30' with no levels in common with the model. If you remove the y label from the "test" set and pass to model.predict() then it works. Was this behavior changed recently ? I am attempting to go through this diff : github.com/h2oai/h2o-3/compare/…dparkar
Hi Atul Were you able to get an answer on this? I am facing a similar issue.Vikram Garg

1 Answers

1
votes

This issue related is with new examples data in particular column that doesn't exist in traing set. I use parsing column types to numeric (or string) in this cases.

def _convert_h2oframe_to_numeric(h2o_frame, training_columns):
    for column in training_columns:
        h2o_frame[column] = h2o_frame[column].asnumeric()
    return h2o_frame

Remember to use this function for training and prediction process.