Skip to content

Commit 90a3b12

Browse files
Copilotmeta-codesync[bot]
authored andcommitted
Update adjusting_sample_to_population.md with current Sample.adjust() output format (#315)
Summary: The documentation showed outdated output format for `Sample.adjust()`. Updated to reflect current behavior from the quickstart tutorial. ## Changes - **Added adjustment details section** with design effect (Deff), effective sample size proportion (ESSP), effective sample size (ESS), method, and weight trimming mean ratio - **Updated target metadata** to correctly show 3 variables (gender, age_group, income) with `outcome_columns: happiness`, matching the quickstart tutorial where target is created with `outcome_columns=["happiness"]` - **Updated formatting** to match current string representation ## Example Current output now shows: ``` Adjusted balance Sample object with target set using ipw 1000 observations x 3 variables: gender,age_group,income id_column: id, weight_column: weight, outcome_columns: happiness adjustment details: method: ipw weight trimming mean ratio: 20 design effect (Deff): 1.880 effective sample size proportion (ESSP): 0.532 effective sample size (ESS): 531.9 target: balance Sample object 10000 observations x 3 variables: gender,age_group,income id_column: id, weight_column: weight, outcome_columns: happiness 3 common variables: gender,age_group,income ``` <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[FEATURE] website/docs/docs/general_framework/adjusting_sample_to_population.md</issue_title> > <issue_description>Update text in: > https://github.com/facebookresearch/balance/blob/main/website/docs/docs/general_framework/adjusting_sample_to_population.md > Based on updated output from here: > https://import-balance.org/docs/tutorials/quickstart/</issue_description> > > ## Comments on the Issue (you are copilot in this section) > > <comments> > </comments> > </details> - Fixes #314 --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. Pull Request resolved: #315 Reviewed By: omriharosh Differential Revision: D92278189 Pulled By: talgalili fbshipit-source-id: e2e5acc095041e2585c48b3e5f57527002ff6215
1 parent ca6de35 commit 90a3b12

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

website/docs/docs/general_framework/adjusting_sample_to_population.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,26 @@ adjusted = sample.adjust()
1515
The output of this method is an adjusted `Sample` class object of the form:
1616

1717
```
18-
Adjusted balance Sample object with target set using ipw
19-
1000 observations x 3 variables: gender,age_group,income
20-
id_column: id, weight_column: weight,
21-
outcome_columns: happiness
18+
Adjusted balance Sample object with target set using ipw
19+
1000 observations x 3 variables: gender,age_group,income
20+
id_column: id, weight_column: weight,
21+
outcome_columns: happiness
2222
23-
target:
23+
adjustment details:
24+
method: ipw
25+
weight trimming mean ratio: 20
26+
design effect (Deff): 1.880
27+
effective sample size proportion (ESSP): 0.532
28+
effective sample size (ESS): 531.9
2429
25-
balance Sample object
26-
10000 observations x 3 variables: gender,age_group,income
27-
id_column: id, weight_column: weight,
28-
outcome_columns: None
30+
target:
2931
30-
3 common variables: income,gender,age_group
32+
balance Sample object
33+
10000 observations x 3 variables: gender,age_group,income
34+
id_column: id, weight_column: weight,
35+
outcome_columns: happiness
36+
37+
3 common variables: gender,age_group,income
3138
```
3239
Note that the `adjust` method in balance is performing three main steps:
3340
1. **Pre-processing** of the data - getting data ready for adjustment using best practices in the field:

0 commit comments

Comments
 (0)