thomasp85 / lime

Local Interpretable Model-Agnostic Explanations (R port of original Python package)
https://lime.data-imaginist.com/
Other
481 stars 109 forks source link

[!] explain() does not work with ordered factors #179

Open dsnavega opened 4 years ago

dsnavega commented 4 years ago

Hi Thomas,

I just noticed the the explain function does not work if the training data (and subsequent test data) has ordered factors.

The explainer stores the feature_type of ordered factors solely as "factor" so the ordering information is lost. It maybe not be important for the logic of the LIME algorithm but breaks the predict function for methods that treat ordered factors differently from unordered factors (i.e. randomForest).

Best