Hi,
when using lime for multi class explanations I noticed that local_pred and score are only stored for the last label. This is because they are overwritten in the loop:
for label in top:
(ret_exp.intercept[label],
ret_exp.local_exp[label],
ret_exp.score, ret_exp.local_pred) = self.base.explain_instance_with_data(
data, labels, distances, label, num_features,
model_regressor=model_regressor,
feature_selection=self.feature_selection)
To make sure I printed the output in the notebook "Tutorial - images - Pytorch":
If you agree this shouldn't be the case I can fix this by implementing local_pred and score as dictionaries like intercept and local_exp.
Yes, that is a bug. I guess making it a dict is the right thing to do, but it will be a breaking change if people are already using it. But yeah, whatever, if you do a pull request I'll accept.
Thanks!
Hi, when using lime for multi class explanations I noticed that
local_pred
andscore
are only stored for the last label. This is because they are overwritten in the loop:To make sure I printed the output in the notebook "Tutorial - images - Pytorch":
If you agree this shouldn't be the case I can fix this by implementing
local_pred
andscore
as dictionaries likeintercept
andlocal_exp
.Best regards Verena