Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix indexing error when creating a filtered error analysis tree view with a dataset that contains categoricals #2026

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

imatiach-msft
Copy link
Contributor

Description

Fix indexing error when creating a filtered error analysis tree view with a dataset that contains categoricals.
Also added repro/test to validate the fix. The indexing was incorrect - we were using row_index array although the categorical indexed data had already been indexed/sampled. Replacing row_index with : resolved the error.

Original user error information:

I used my existing dashboard, created a cohort (True Y = 0) and switched to that cohort. This created the following error:

image

Failed to retrieve selected tree map metric: Failed to generate json tree representation,inner error: Traceback (most recent call last): File "/azureml-envs/responsibleai-0.24/lib/python3.8/site-packages/raiwidgets/responsibleai_dashboard_input.py", line 140, in debug_ml tree = self._error_analyzer.compute_error_tree_on_dataset( File "/azureml-envs/responsibleai-0.24/lib/python3.8/site-packages/erroranalysis/analyzer/error_analyzer.py", line 361, in compute_error_tree_on_dataset return _compute_error_tree_on_dataset( File "/azureml-envs/responsibleai-0.24/lib/python3.8/site-packages/erroranalysis/_internal/surrogate_error_tree.py", line 154, in compute_error_tree_on_dataset booster, dataset_indexed_df, cat_info = get_surrogate_booster_local( File "/azureml-envs/responsibleai-0.24/lib/python3.8/site-packages/erroranalysis/_internal/surrogate_error_tree.py", line 332, in get_surrogate_booster_local input_data[:, c_i] = string_indexed_data[row_index, idx] IndexError: index 760 is out of bounds for axis 0 with size 759

Checklist

  • I have added screenshots above for all UI changes.
  • I have added e2e tests for all UI changes.
  • Documentation was updated if it was needed.

@codecov-commenter
Copy link

Codecov Report

Merging #2026 (ea4f305) into main (dd7d6d5) will increase coverage by 0.91%.
The diff coverage is 100.00%.

❗ Current head ea4f305 differs from pull request most recent head a142b8b. Consider uploading reports for the commit a142b8b to get more accurate results

@@            Coverage Diff             @@
##             main    #2026      +/-   ##
==========================================
+ Coverage   92.15%   93.07%   +0.91%     
==========================================
  Files          64       48      -16     
  Lines        4322     1963    -2359     
==========================================
- Hits         3983     1827    -2156     
+ Misses        339      136     -203     
Flag Coverage Δ
unittests 93.07% <100.00%> (+0.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...is/erroranalysis/_internal/surrogate_error_tree.py 89.57% <100.00%> (ø)

... and 78 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

1 similar comment
@imatiach-msft imatiach-msft merged commit 154c4f9 into main Apr 5, 2023
@imatiach-msft imatiach-msft deleted the ilmat/ea-filter-cat-indx-err branch April 5, 2023 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants