marcotcr / lime

Lime: Explaining the predictions of any machine learning classifier
BSD 2-Clause "Simplified" License
11.64k stars 1.81k forks source link

IndexError: index unknown_value is out of bounds for axis 0 with size len(categorical_names) #641

Open duducrail opened 3 years ago

duducrail commented 3 years ago

Hi, I'm using a OrdinalEnconder in the training dataset and put an unknown_value =99999. In my validation dataset, I have one new category that didn't appear in the training dataset. When I try to run this particular case in the explain_instance, I have a mismatch between my categorical_names and this new one (set 99999). Apparently, It can't find a related category. What can I do in this case?