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

Port cohort.py from raiwidgets to raiutils #1859

Merged
merged 6 commits into from
Dec 21, 2022
Merged

Conversation

gaugup
Copy link
Contributor

@gaugup gaugup commented Dec 16, 2022

Description

Port cohort.py from raiwidgets to raiutils. Also porting over the exception class UserConfigValidationException. This PR is for unblocking the release for RAI mitigation library as they want to take dependency on cohort.py module from raiutils instead of raiwidgets.

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.

@gaugup gaugup requested a review from imatiach-msft December 16, 2022 23:20
@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2022

Codecov Report

Merging #1859 (7ea856b) into main (2a803f0) will increase coverage by 11.08%.
The diff coverage is 94.17%.

@@             Coverage Diff             @@
##             main    #1859       +/-   ##
===========================================
+ Coverage   79.00%   90.09%   +11.08%     
===========================================
  Files          19      112       +93     
  Lines        1324     5874     +4550     
===========================================
+ Hits         1046     5292     +4246     
- Misses        278      582      +304     
Flag Coverage Δ
unittests 90.09% <94.17%> (+11.08%) ⬆️

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

Impacted Files Coverage Δ
raiutils/raiutils/cohort/cohort.py 92.68% <92.68%> (ø)
raiutils/raiutils/cohort/__init__.py 100.00% <100.00%> (ø)
raiutils/raiutils/cohort/constants.py 100.00% <100.00%> (ø)
raiutils/raiutils/exceptions.py 100.00% <100.00%> (ø)
raiutils/raiutils/version.py 100.00% <100.00%> (ø)
...tools/counterfactual/dashboard_schemas/__init__.py 100.00% <0.00%> (ø)
responsibleai/responsibleai/managers/__init__.py 100.00% <0.00%> (ø)
...ponsibleai/responsibleai/_tools/causal/__init__.py 100.00% <0.00%> (ø)
...nalysis/erroranalysis/_internal/version_checker.py 50.00% <0.00%> (ø)
...s/erroranalysis/_internal/error_report/__init__.py 100.00% <0.00%> (ø)
... and 84 more

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

Copy link
Contributor

@romanlutz romanlutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaugup can you confirm that there are no changes in here, just copy-pasting?

@gaugup
Copy link
Contributor Author

gaugup commented Dec 19, 2022

@gaugup can you confirm that there are no changes in here, just copy-pasting?

yes, no new code. Just some constants requested by RAI mitigations project owners.

Signed-off-by: Gaurav Gupta <[email protected]>
Signed-off-by: Gaurav Gupta <[email protected]>
1 similar comment
@gaugup gaugup enabled auto-merge (squash) December 21, 2022 07:13
@gaugup gaugup merged commit afda945 into main Dec 21, 2022
@gaugup gaugup deleted the gaugup/AddCohortToRAIUtils branch December 21, 2022 14:24
gaugup added a commit that referenced this pull request Dec 21, 2022
* Port cohort.py from raiwidgets to raiutils

Signed-off-by: Gaurav Gupta <[email protected]>

* Add more constants

Signed-off-by: Gaurav Gupta <[email protected]>

* Add constants.py

Signed-off-by: Gaurav Gupta <[email protected]>

* Make constants public

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>
gaugup added a commit that referenced this pull request Dec 21, 2022
* Add metric SDK APIs for Model Overview metrics

Signed-off-by: Gaurav Gupta <[email protected]>

* remove console.log()

Signed-off-by: Gaurav Gupta <[email protected]>

* Port `cohort.py` from `raiwidgets` to `raiutils` (#1859)

* Port cohort.py from raiwidgets to raiutils

Signed-off-by: Gaurav Gupta <[email protected]>

* Add more constants

Signed-off-by: Gaurav Gupta <[email protected]>

* Add constants.py

Signed-off-by: Gaurav Gupta <[email protected]>

* Make constants public

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

* lint fix

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>
gaugup added a commit that referenced this pull request Jan 6, 2023
* Port cohort.py from raiwidgets to raiutils

Signed-off-by: Gaurav Gupta <[email protected]>

* Add more constants

Signed-off-by: Gaurav Gupta <[email protected]>

* Add constants.py

Signed-off-by: Gaurav Gupta <[email protected]>

* Make constants public

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>
gaugup added a commit that referenced this pull request Jan 6, 2023
* Add metric SDK APIs for Model Overview metrics

Signed-off-by: Gaurav Gupta <[email protected]>

* remove console.log()

Signed-off-by: Gaurav Gupta <[email protected]>

* Port `cohort.py` from `raiwidgets` to `raiutils` (#1859)

* Port cohort.py from raiwidgets to raiutils

Signed-off-by: Gaurav Gupta <[email protected]>

* Add more constants

Signed-off-by: Gaurav Gupta <[email protected]>

* Add constants.py

Signed-off-by: Gaurav Gupta <[email protected]>

* Make constants public

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

* lint fix

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>
gaugup added a commit that referenced this pull request Jan 6, 2023
* Add missing property 'id' in ICounterfactualData

Signed-off-by: Gaurav Gupta <[email protected]>

* Update some sample notebooks to include dropped_features (#1836)

* update some notebooks to include dropped_features

* update some notebooks to include dropped_features

* update some notebooks to include dropped_features

* remove unused changes

* remove unused changes

* address comments

* upgrade setup-python github action from v2 to v4 and pin to older ubuntu image for python 3.6 to fix build error (#1838)

* Gate call to probability distribution end point (#1839)

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Revert "Update some sample notebooks to include dropped_features (#1836)" (#1837)

This reverts commit d89b03a.

* fix cf error on unable to update text (#1842)

* Disable partial dependence plots for large data scenarios (#1843)

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Remove redundant call to serialize_json_safe() in raiwidgets causal tests (#1840)

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Fetching global causal effects and global policy from SDK backend (#1753)

* Add callback for global causal effects

Signed-off-by: Gaurav Gupta <[email protected]>

* Query SDK backend to get global causal effects

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix bug in causal serialization

Signed-off-by: Gaurav Gupta <[email protected]>

* Adding callback for causal ploicy

Signed-off-by: Gaurav Gupta <[email protected]>

* propagate global and local effects only

Signed-off-by: Gaurav Gupta <[email protected]>

* Add support for getting global causal effects from SDK backend

Signed-off-by: Gaurav Gupta <[email protected]>

* lint fix

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix bug

Signed-off-by: Gaurav Gupta <[email protected]>

* Modify the cohort message

Signed-off-by: Gaurav Gupta <[email protected]>

* Move to state

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix imports

Signed-off-by: Gaurav Gupta <[email protected]>

* Remove console.log

Signed-off-by: Gaurav Gupta <[email protected]>

* Change the if condition

Signed-off-by: Gaurav Gupta <[email protected]>

* Add postga build trigger (#1755) (#1756)

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Add model wrapper for wrapping predictions and test data (#1762)

* Add model wrapper for wrapping predictions and test data

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix failing tests

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

* Remove force update

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Update requirements-linting.txt (#1847)

* Remove typo casual and correcting it to causal (#1846)

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Disable local causal chart for large data support (#1845)

* Disable local causal chart for large data support

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* add multilabel text example and fix correct and incorrect groups in data analysis (#1848)

* Add number of cohort samples inside generateMetrics() (#1849)

* Add number of cohort samples inside generateMetrics()

Signed-off-by: Gaurav Gupta <[email protected]>

* Yarn lintfix

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* add multilabel RAI vision example for fridge multilabel dataset (#1844)

* fix install command for speech to text example (#1856)

* Send the correct column name to SDK backend for model overview distribution charts (#1835)

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Derive fairness metrics from metric stats instead of cohort stats (#1854)

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* add upper bounds to greenlet and gevent in rai-core-flask as 5.0 release fails until they are more stable (#1852)

* fix loading older versions of RAIInsights due to _FEATURE_METADATA key error (#1857)

* Update maintainers (#1860)

* Update requirements.txt in `raiwidgets` and `responsibleai` to pin numpy upper bound (#1864)

* Update requirements.txt

* Update requirements.txt

* Port `cohort.py` from `raiwidgets` to `raiutils` (#1859)

* Port cohort.py from raiwidgets to raiutils

Signed-off-by: Gaurav Gupta <[email protected]>

* Add more constants

Signed-off-by: Gaurav Gupta <[email protected]>

* Add constants.py

Signed-off-by: Gaurav Gupta <[email protected]>

* Make constants public

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Add common APIs for model overview metrics (#1862)

* Add metric SDK APIs for Model Overview metrics

Signed-off-by: Gaurav Gupta <[email protected]>

* remove console.log()

Signed-off-by: Gaurav Gupta <[email protected]>

* Port `cohort.py` from `raiwidgets` to `raiutils` (#1859)

* Port cohort.py from raiwidgets to raiutils

Signed-off-by: Gaurav Gupta <[email protected]>

* Add more constants

Signed-off-by: Gaurav Gupta <[email protected]>

* Add constants.py

Signed-off-by: Gaurav Gupta <[email protected]>

* Make constants public

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

* lint fix

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Update requirements-linting.txt (#1861)

* update raiwidgets to rai-core-flask v0.5.0 (#1851)

* fix error in erroranalysis heatmap caused by max value over right side of max bin (#1866)

* remove dead space in aggregate feature importance (#1869)

* display tree branching decisions (#1870)

* Remove warning for 'dropped_features are not in use currently.' (#1871)

* display tree branching decisions

* Remove warning for 'dropped_features are not in use currently.'

* turn off fail-fast for python tests (#1878)

* add multilabel model overview metrics (#1882)

* Show branching decisions on hover over on unselected tree nodes (#1881)

* show tree label on hover over

* address comments

* Update some sample notebooks to include dropped_features (#1836)

* update some notebooks to include dropped_features

* update some notebooks to include dropped_features

* update some notebooks to include dropped_features

* remove unused changes

* remove unused changes

* address comments

* Revert "Update some sample notebooks to include dropped_features (#1836)" (#1837)

This reverts commit d89b03a.

* Update requirements-linting.txt (#1847)

* Add number of cohort samples inside generateMetrics() (#1849)

* Add number of cohort samples inside generateMetrics()

Signed-off-by: Gaurav Gupta <[email protected]>

* Yarn lintfix

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Update requirements-linting.txt (#1861)

* add multilabel model overview metrics (#1882)

* Update `raiutils` in `raiwidgets`, `responsibleai`, `erroranalysis` and `nlp_feature_extractors` (#1873)

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix test

Signed-off-by: Gaurav Gupta <[email protected]>

* Undo changes

Signed-off-by: Gaurav Gupta <[email protected]>

* Fix lint

Signed-off-by: Gaurav Gupta <[email protected]>

Signed-off-by: Gaurav Gupta <[email protected]>
Co-authored-by: tongy-msft <[email protected]>
Co-authored-by: Ilya Matiach <[email protected]>
Co-authored-by: Roman Lutz <[email protected]>
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.

4 participants