marcotcr / lime

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

Submodular pick with ImageExplanation objects #553

Closed jayneelparekh closed 3 years ago

jayneelparekh commented 3 years ago

I am trying to generate global explanations using LIME on images. Can anyone point to me how to run the submodular pick algorithm for ImageExplanation objects or for images in general.

I run into the error: " AttributeError: 'ImageExplanation' object has no attribute 'mode' ". It seems to me that code for ImageExplanation class (in lime_image.py) needs to be updated.

Any help about how to proceed to fix this, other ways around (or if I am mistaken somewhere) would be highly appreciated.

marcotcr commented 3 years ago

Submodular pick does not work for images, unless you have features that generalize across image (we don't, since we're using superpixels of specific images).