lime icon indicating copy to clipboard operation
lime copied to clipboard

Calculate r2 score

Open SamiurRahman1 opened this issue 3 years ago • 3 comments

Is it possible to calculate the r2 score of the surrogate model? Can this feature be added?

SamiurRahman1 avatar Mar 09 '22 00:03 SamiurRahman1

did you solve this issue in any way?

genny92cst avatar Mar 23 '22 10:03 genny92cst

no. unfortunately not.. :(

SamiurRahman1 avatar Mar 23 '22 10:03 SamiurRahman1

Hello This is a pretty easy thing to do since it has been implemented before in this library. To find the r2 score of the surrogate model you can use the score parameter that is returned from the explain_instance method. It's actually the r2 score of the surrogate model (which is by default the ridge regression). To do it

explanation = explain_instance(data, ... and some parameters)
print(explanation.score)

amindadgar avatar Dec 27 '22 18:12 amindadgar