Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

H2O AutoML error Test/Validation dataset has a non-categorical column which is categorical in the training data" on predict

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.

like image 327
ATUL AGARWAL Avatar asked Aug 16 '19 12:08

ATUL AGARWAL


1 Answers

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.

like image 140
CezarySzulc Avatar answered Oct 17 '22 23:10

CezarySzulc