synthesized-io / insight

🧿 Metrics & Monitoring of Datasets
BSD 3-Clause "New" or "Revised" License
12 stars 0 forks source link

Added ChiSquareContingency #179

Open marqueewinq opened 5 months ago

marqueewinq commented 5 months ago

Adding a KSD analog for a categoricals.

I may need help with the meaningful normalized_chi2 calculation for comparison -- let me know if you want to change the way it's done. Some idea:

        max_chi2 = dof * contingency_table.values.sum()
        normalized_chi2 = chi2 / max_chi2
codecov[bot] commented 5 months ago

Codecov Report

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

Comparison is base (88dac15) 78.8% compared to head (088a6f3) 79.0%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/synthesized-io/insight/pull/179/graphs/tree.svg?width=650&height=150&src=pr&token=S8CD8EN4AF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synthesized-io)](https://app.codecov.io/gh/synthesized-io/insight/pull/179?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synthesized-io) ```diff @@ Coverage Diff @@ ## master #179 +/- ## ======================================== + Coverage 78.8% 79.0% +0.2% ======================================== Files 11 11 Lines 968 988 +20 Branches 160 163 +3 ======================================== + Hits 763 781 +18 - Misses 153 154 +1 - Partials 52 53 +1 ``` | [Files](https://app.codecov.io/gh/synthesized-io/insight/pull/179?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synthesized-io) | Coverage Δ | | |---|---|---| | [src/insight/metrics/\_\_init\_\_.py](https://app.codecov.io/gh/synthesized-io/insight/pull/179?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synthesized-io#diff-c3JjL2luc2lnaHQvbWV0cmljcy9fX2luaXRfXy5weQ==) | `100.0% <ø> (ø)` | | | [src/insight/metrics/metrics.py](https://app.codecov.io/gh/synthesized-io/insight/pull/179?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synthesized-io#diff-c3JjL2luc2lnaHQvbWV0cmljcy9tZXRyaWNzLnB5) | `92.1% <90.4%> (-0.2%)` | :arrow_down: |
sonarcloud[bot] commented 5 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
3 New Major Issues (required ≤ 0)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

marqueewinq commented 5 months ago

Can ignore sonar reqs