Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
kumarprakashmani opened this issue Aug 17, 2021 · 1 comment
Open

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

kumarprakashmani opened this issue Aug 17, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@kumarprakashmani
Copy link

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
Copy link
Contributor

luisffranca commented Aug 17, 2021

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?

@paulbkoch paulbkoch added the bug Something isn't working label Feb 10, 2023
@paulbkoch paulbkoch mentioned this issue Feb 10, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants