It seems that the functions only work for categorical variables coded as ints.
I had to do something like this before running the code:
for f in cat_features:
data[f] = data[f].astype('category')
data[cat_features] = data[cat_features].apply(lambda x: x.cat.codes)
I think that you should include it in the functions, and translate the results back to categories.
It seems that the functions only work for categorical variables coded as ints. I had to do something like this before running the code: for f in cat_features: data[f] = data[f].astype('category') data[cat_features] = data[cat_features].apply(lambda x: x.cat.codes) I think that you should include it in the functions, and translate the results back to categories.