lime icon indicating copy to clipboard operation
lime copied to clipboard

top_label

Open ElineideSilva opened this issue 3 years ago • 1 comments

The top_label is the number of classes?

My problem has 4 classes, even if I put a top_label=10 it always returns 4

ElineideSilva avatar Nov 02 '22 01:11 ElineideSilva

From the source code:

yss = predict_fn(inverse)  # Array of probabilty per class
...
if top_labels:
    labels = np.argsort(yss[0])[-top_labels:]

Not quite, It limits the number of labels you get explainations for. Let's say you have 50 classes and you set it to 10 then you will get the 10 labels with the highest probability based on the prediction for the inverse values. If you have four classes on the other hand, but you set it to 10, it will only return 4, because there are no more labels in the list.

paulbauriegel avatar Nov 02 '22 23:11 paulbauriegel