Skip to content

Simplified data adequacy - #424

Open
jmafoster1 wants to merge 3 commits into
mainfrom
jmafoster1/sigmoid
Open

jmafoster1 wants to merge 3 commits into
mainfrom
jmafoster1/sigmoid

Conversation

@jmafoster1

@jmafoster1 jmafoster1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR adds an "easy interpret" option for causal data adequacy that puts the absolute kurtosis value through a sigmoid function and converts it to a "percentage". Closes #412. Credit to @SylviaWhittle for the original idea. Hope this isn't stepping on your toes, I just thought it'd be good to get it in the paper (which I plan to write this week).

What I ended up doing was taking the absolute kurtosis value and putting that through a sigmoid such that kurtoses close to zero correspond to values close to 100 and kurtoses far from zero correspond to values close to zero. A kurtosis of -0.8 corresponds to 50, since a uniform distribution (which represents just about the worst case that it's possible to get here) has a kurtosis of -1.2. Using -0.8 roughly corresponds to a distribution that's visually "about half way" between a uniform distribution and the normal distribution that gives a perfect value (the scale is not linear).

Main file changes

causal_testing/testing/data_adequacy.py - added a simplified_kurtosis function.

I also added the option to flip between raw and simplified values in the dashboard (with simplified being the default) and added explanations in there.

The other changes are tests and docs.

Checklist

Before you mark your PR as ready for review, please ensure you have completed the following.

  • Added unit tests for new functionality
  • Properly documented any new code
  • Updated Sphinx documentation in docs/ and checked for updated configuration/runtime options
  • Added a jupyter notebook tutorial in docs/source/tutorials for any new functionality
  • Verified local docs build with sphinx-build -W source/ build

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
⚠️ PYTHON black 35 1 0.89s
✅ PYTHON pylint 35 0 5.44s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.95%. Comparing base (7188c3d) to head (3c494de).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #424      +/-   ##
==========================================
+ Coverage   97.94%   97.95%   +0.01%     
==========================================
  Files          29       29              
  Lines        1898     1910      +12     
==========================================
+ Hits         1859     1871      +12     
  Misses         39       39              
Files with missing lines Coverage Δ
causal_testing/testing/data_adequacy.py 100.00% <100.00%> (ø)
causal_testing/visualisation/geometry.py 100.00% <ø> (ø)
causal_testing/visualisation/testing_dashboard.py 100.00% <ø> (ø)
...sal_testing/visualisation/visualisation_plotter.py 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8abdd0c...3c494de. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jmafoster1
jmafoster1 marked this pull request as ready for review November 3, 2026 11:28
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.

Sigmoid test adequacy

1 participant