y0-causal-inference / y0

❓y0 (pronounced "why not?") is for causal inference in Python
https://y0.readthedocs.io
BSD 3-Clause "New" or "Revised" License
44 stars 10 forks source link

Automate checking binary/continous data #194

Closed cthoyt closed 11 months ago

cthoyt commented 11 months ago

As a follow-up to #193, this PR extends the default conditional independency test from just being the Cressie-Read test to dynamically checking if the data is binary or not. If it's binary, it stays with cressie read but if it's continuous, it sets it to the Pearson test.

This implementation doesn't yet consider discrete data with more than 2 values. The idea Pruthvi had in eliater was to manually specify a threshold. I don't like this since it's parametric, and if you already know what's going on in your data, you might as well set the test correctly. An idea for an automated test is in here for future reference: https://stats.stackexchange.com/questions/12273/how-to-test-if-my-data-is-discrete-or-continuous

codecov[bot] commented 11 months ago

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (bc2317c) 77.26% compared to head (5561b1a) 77.74%. Report is 1 commits behind head on main.

Files Patch % Lines
src/y0/struct.py 80.95% 2 Missing and 2 partials :warning:
src/y0/algorithm/falsification.py 66.66% 2 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #194 +/- ## ========================================== + Coverage 77.26% 77.74% +0.47% ========================================== Files 45 45 Lines 3040 3065 +25 Branches 676 684 +8 ========================================== + Hits 2349 2383 +34 + Misses 599 583 -16 - Partials 92 99 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.