Skip to content

Conversation

@jmafoster1
Copy link
Collaborator

@jmafoster1 jmafoster1 commented Dec 11, 2025

Previously, the logistic regression estimator produced results as

"result": {
      "treatment": "X",
      "outcome": "Y",
      "adjustment_set": [],
      "effect_measure": "unit_odds_ratio",
      "effect_estimate": {
        "0": 3.00
      },
      "ci_low": {
        "0": 2.64
      },
      "ci_high": {
        "0": 3.40
      }
}

This was somewhat confusing, especially for numeric (i.e. non-categorical) treatments. I have now made it so it indexes by name instead

"result": {
      "treatment": "X",
      "outcome": "Y",
      "adjustment_set": [],
      "effect_measure": "unit_odds_ratio",
      "effect_estimate": {
        "X": 3.00
      },
      "ci_low": {
        "X": 2.64
      },
      "ci_high": {
        "X": 3.40
      }
}

Categorical treatments are indexed as

"result": {
      "treatment": "X",
      "outcome": "Y",
      "adjustment_set": [],
      "effect_measure": "unit_odds_ratio",
      "effect_estimate": {
        "X[T.red]": 3.00,
        "X[T.blue]": -2.21
      },
      "ci_low": {
        "X[T.red]": 2.64,
        "X[T.blue]": -3.18
      },
      "ci_high": {
        "X[T.red]": 3.40,
        "X[T.blue]": -1.87
      }
}

This PR also fixes a minor bug from #365 where test adequacy would always be set to True, and makes the commandline arguments consistently use - as a delimiter, e.g. --dag_path -> --dag-path

@github-actions
Copy link

github-actions bot commented Dec 11, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 33 0 0.96s
✅ PYTHON pylint 33 0 6.18s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.64%. Comparing base (8185ad8) to head (30a4250).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #369      +/-   ##
==========================================
+ Coverage   96.31%   96.64%   +0.32%     
==========================================
  Files          28       28              
  Lines        1603     1608       +5     
==========================================
+ Hits         1544     1554      +10     
+ Misses         59       54       -5     
Files with missing lines Coverage Δ
...esting/estimation/logistic_regression_estimator.py 100.00% <100.00%> (ø)
causal_testing/main.py 100.00% <100.00%> (+2.05%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5449dda...30a4250. 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 December 11, 2025 11:48
@jmafoster1 jmafoster1 requested a review from f-allian December 11, 2025 11:48
@jmafoster1 jmafoster1 merged commit f3d2915 into main Dec 11, 2025
16 checks passed
@jmafoster1 jmafoster1 deleted the jmafoster1/named-confidence-intervals branch December 11, 2025 13:12
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.

3 participants