interpretml / interpret

Fit interpretable models. Explain blackbox machine learning.
https://interpret.ml/docs
MIT License
6.28k stars 729 forks source link

ClassHistogram().explain_data() having index error.... #274

Open kumarprakashmani opened 3 years ago

kumarprakashmani commented 3 years ago

from interpret.data import ClassHistogram hist = ClassHistogram().explain_data(X_train, y_train, name = 'ESR_Count') show(hist)


IndexError Traceback (most recent call last)

in ----> 1 show(hist) C:\anaconda\lib\site-packages\interpret\visual\interactive.py in show(explanation, key, **kwargs) 170 except Exception as e: # pragma: no cover 171 log.error(e, exc_info=True) --> 172 raise e 173 174 return None C:\anaconda\lib\site-packages\interpret\visual\interactive.py in show(explanation, key, **kwargs) 167 168 # Render --> 169 this.visualize_provider.render(explanation, key=key, **kwargs) 170 except Exception as e: # pragma: no cover 171 log.error(e, exc_info=True) C:\anaconda\lib\site-packages\interpret\provider\visualize.py in render(self, explanation, key, **kwargs) 222 from ..visual.inline import render 223 --> 224 render( 225 explanation, 226 default_key=key, C:\anaconda\lib\site-packages\interpret\visual\inline.py in render(explanation, id_str, default_key, detected_envs, js_url) 214 viz_obj = _build_viz_err_obj(msg) 215 else: --> 216 viz_obj = _build_viz_obj(explanation) 217 218 init_js, body_js = _build_javascript( C:\anaconda\lib\site-packages\interpret\visual\inline.py in _build_viz_obj(explanation) 98 selector_obj = {"columns": [], "data": []} 99 else: --> 100 specific = [ 101 _build_viz_figure(explanation.visualize(i)) 102 for i in range(len(explanation.selector)) C:\anaconda\lib\site-packages\interpret\visual\inline.py in (.0) 99 else: 100 specific = [ --> 101 _build_viz_figure(explanation.visualize(i)) 102 for i in range(len(explanation.selector)) 103 ] C:\anaconda\lib\site-packages\interpret\data\response.py in visualize(self, key) 419 fig = plot_density( 420 data_dict, --> 421 color=COLORS[idx], 422 name=str(current_class), 423 is_categorical=is_categorical, IndexError: list index out of range
luisffranca commented 3 years ago

Hi @kumarprakashmani ,

Thanks for reporting the issue. Could you please let us know in which Notebook environment are you getting this error? And provide an example of how your X_train and Y_train look like?

Moreover, Is this notebook's ClassHistogram() working in your environment?