interpret icon indicating copy to clipboard operation
interpret copied to clipboard

Decision Rule

Open kjk111 opened this issue 4 years ago • 2 comments

Hi, When I run the python code of Decision Rule on Jupyter, there is a need to add: import six import sys sys.modules['sklearn.externals.six'] = six

However, there is still an error when I run the line code: dl_local = dl.explain_local(X_test[:5], y_test[:5]) show(dl_local) the error is: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% _KeyError Traceback (most recent call last) in 4 #show(dl_local) 5 ----> 6 dl_local = dl.explain_local(X_test[:100], y_test[:100])

~\Anaconda3\lib\site-packages\interpret\glassbox\skoperules.py in explain_local(self, X, y, name) 285 286 internal_obj = {"overall": None, "specific": data_dicts} --> 287 selector = gen_local_selector(data_dicts, is_classification=True) 288 289 return RulesExplanation(

~\Anaconda3\lib\site-packages\interpret\utils\all.py in gen_local_selector(data_dicts, round, is_classification) 114 115 for data_dict in data_dicts: --> 116 perf_dict = data_dict["perf"] 117 record = {} 118 record["PrScore"] = perf_dict["predicted_score"]

KeyError: 'perf'_ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I thank you in advance for your help to resolve this problem.

kjk

kjk111 avatar Jun 07 '21 16:06 kjk111

Hi @kjk111,

Thanks for reporting this. Do you mind sharing your Python and interpret version numbers with us? I'm having trouble reproducing this on my side.

You can get your Python version number from your command line with:

python -V

and interpret version number with:

pip show interpret # assuming it was installed through pip.

Appreciate you taking the time to report this to us! -InterpretML Team

interpret-ml avatar Jun 14 '21 13:06 interpret-ml

Hi @interpret-ml,

python -V Python 3.8.5

pip show interpret Name: interpret Version: 0.2.2 Summary: Fit interpretable machine learning models. Explain blackbox machine learning. Home-page: https://github.com/interpretml/interpret

I thank you in advance for your consideration. kjk

kjk111 avatar Jun 17 '21 00:06 kjk111

Hi @kjk111 -- Looking through the history, I believe this was resolved in v0.2.3 with commit https://github.com/interpretml/interpret/commit/b3f83f5efb8be3130cec824511696e779bd43968

Thank you for reporting this bug!

paulbkoch avatar Mar 14 '23 18:03 paulbkoch