Enhance adjusted sample summary output#194
Enhance adjusted sample summary output#194neuralsorcerer wants to merge 10 commits intofacebookresearch:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the string representation of adjusted Sample objects by adding detailed diagnostic information about the adjustment process. When a Sample has been adjusted, users now see the adjustment method, any weight trimming parameters applied, and key weight diagnostics including design effect and effective sample size.
Key Changes:
- Added
adjustment detailssection to Sample.str() that displays adjustment method, trimming parameters (when present), and weight diagnostics (design effect and effective sample size) - Updated tests to verify the new adjustment details are properly displayed in the string representation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| balance/sample_class.py | Implements the new adjustment details section in the __str__ method, extracting method and trimming parameters from the model dict, computing design effect and effective sample size when applicable |
| tests/test_sample.py | Adds test assertions to verify that adjustment details, method name, and design effect are present in the string representation of adjusted samples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Cool! |
talgalili
left a comment
There was a problem hiding this comment.
Thanks @neuralsorcerer
Could you please add a simple 'Examples' section, so I'll be able to see how the output is supposed to look like?
(this would make it easier to decide if it's closing the original issue, or if something is missing)
Added a simple example as part of docstring. |
talgalili
left a comment
There was a problem hiding this comment.
Thanks.
I think we're almost there.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@talgalili has imported this pull request. If you are a Meta employee, you can view this in D88296085. |
|
@neuralsorcerer has updated the pull request. You must reimport the pull request before landing. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@neuralsorcerer has updated the pull request. You must reimport the pull request before landing. |
|
@talgalili merged this pull request in 44df914. |
Added adjustment details to the
Samplestring representation, including method, trimming parameters, and quick weight diagnostics such as design effect and effective sample size when available.