marcotcr / lime

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

regression explanation intercept has duplicated values #649

Open yinxi-db opened 2 years ago

yinxi-db commented 2 years ago

For a regression model explainer below

explainer = LimeTabularExplainer(X_train, feature_names, mode="regression")
exp = explainer.explain_instance(X_test[0], model, num_features=11)

The returned explanation still has two intercept

print(exp.intercept)
>>>{0: 6.051529868550603, 1: 6.051529868550603}

exp.intercept[0] and exp.intercept[1] are duplicated values. The same applies to exp.local_exp[0] and exp.local_exp[0]. Suggest to consolidate the regression explanation object.