Skip to content

Add test coverage for IPW helpers#341

Closed
neuralsorcerer wants to merge 3 commits intofacebookresearch:mainfrom
neuralsorcerer:help
Closed

Add test coverage for IPW helpers#341
neuralsorcerer wants to merge 3 commits intofacebookresearch:mainfrom
neuralsorcerer:help

Conversation

@neuralsorcerer
Copy link
Collaborator

@neuralsorcerer neuralsorcerer commented Feb 19, 2026

  • model_coefs() already has explicit tests for linear-model coefficient extraction (including intercept + named features) and non-linear-model empty coefficient behavior.
  • link_transform() now has coverage for midpoint and extreme probability clipping behavior.
  • calc_dev() now has coverage ensuring finite, non-negative 10-fold CV deviance outputs.

Copilot AI review requested due to automatic review settings February 19, 2026 11:37
@meta-cla meta-cla bot added the cla signed label Feb 19, 2026
@neuralsorcerer neuralsorcerer added this to the balance 0.17.0 milestone Feb 19, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds focused unit test coverage for three previously untested IPW helper functions: model_coefs(), link_transform(), and calc_dev(). The tests validate core behavior including coefficient extraction for linear vs non-linear models, probability clipping at extremes, and finite deviance outputs from cross-validation.

Changes:

  • Added three new test methods covering model_coefs(), link_transform(), and calc_dev() helper functions
  • Removed TODO comments from the source file indicating tests were needed for these functions
  • Updated CHANGELOG with entry describing the new test coverage

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_ipw.py Added three focused unit tests for IPW helper functions, testing linear/non-linear model coefficients, probability clipping behavior, and cross-validation deviance outputs
balance/weighting_methods/ipw.py Removed three TODO comments indicating tests were needed for model_coefs(), link_transform(), and calc_dev()
CHANGELOG.md Added entry under Tests section documenting the new IPW helper test coverage

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@meta-codesync
Copy link

meta-codesync bot commented Feb 19, 2026

@talgalili has imported this pull request. If you are a Meta employee, you can view this in D93743291.

@meta-codesync
Copy link

meta-codesync bot commented Feb 19, 2026

@talgalili merged this pull request in 09102a3.

@neuralsorcerer neuralsorcerer deleted the help branch February 23, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants