mggg / ecological-inference

Ecological inference, in Python
MIT License
28 stars 11 forks source link

Add RxC polarization functions #44

Closed gabeschoenbach closed 3 years ago

gabeschoenbach commented 3 years ago

Added the RxC polarization functions, and then provided tests for both the 2x2 and RxC versions.

RxC polarization function:

Changes to the 2x2 polarization functions include:

Tests:

Also updated the .pylintrc config file to not ignore comments, since I have some duplicate code that should pass the linting. So then I just added some small comments around this duplicate code to get it to pass — a bit of a hack. Finally, added examples in both the 2x2 and RxC Santa Clara demo notebooks!

karink520 commented 3 years ago

Lots of good stuff here - I like the switch to groups[0], groups[1] and think there will be more we can do down the line to keep making RxC and 2x2 more compatible (we're probably due for a bigger refactor there at some point, but I want to wait until we have the last couple methods implemented first). Glad you caught and fixed the percentile/probability issue, and thanks for putting in a corresponding test too!