|
3 | 3 | "docstring": "Set 2025 ACA take-up to match APTC enrollment targets.", |
4 | 4 | "id": "aca_2025_override", |
5 | 5 | "kind": "function", |
6 | | - "line": 421, |
| 6 | + "line": 403, |
7 | 7 | "metadata": { |
8 | 8 | "api_refs": [ |
9 | 9 | "policyengine_us_data.datasets.cps.enhanced_cps.create_aca_2025_takeup_override" |
|
61 | 61 | "docstring": "\"Add auto loan balance, interest and net_worth variable.", |
62 | 62 | "id": "add_auto_loan", |
63 | 63 | "kind": "function", |
64 | | - "line": 2792, |
| 64 | + "line": 2798, |
65 | 65 | "metadata": { |
66 | 66 | "api_refs": [ |
67 | 67 | "policyengine_us_data.datasets.cps.cps.add_auto_loan_interest_and_net_worth" |
|
88 | 88 | "docstring": "Populate household-level geography variables used by PolicyEngine US.\n\nArgs:\n cps: Output CPS H5 group receiving derived household variables.\n household: Raw CPS household table.", |
89 | 89 | "id": "add_household_variables", |
90 | 90 | "kind": "function", |
91 | | - "line": 1454, |
| 91 | + "line": 1460, |
92 | 92 | "metadata": { |
93 | 93 | "api_refs": [ |
94 | 94 | "policyengine_us_data.datasets.cps.cps.add_household_variables" |
|
115 | 115 | "docstring": "Add basic ID and weight variables.\n\nArgs:\n cps (h5py.File): The CPS dataset file.\n person (DataFrame): The person table of the ASEC.\n tax_unit (DataFrame): The tax unit table created from the person table\n of the ASEC.\n family (DataFrame): The family table of the ASEC.\n spm_unit (DataFrame): The SPM unit table created from the person table\n of the ASEC.\n household (DataFrame): The household table of the ASEC.", |
116 | 116 | "id": "add_id_variables", |
117 | 117 | "kind": "function", |
118 | | - "line": 933, |
| 118 | + "line": 931, |
119 | 119 | "metadata": { |
120 | 120 | "api_refs": [ |
121 | 121 | "policyengine_us_data.datasets.cps.cps.add_id_variables" |
|
142 | 142 | "docstring": "Impute ORG-derived wage and union inputs onto CPS persons.", |
143 | 143 | "id": "add_org_inputs", |
144 | 144 | "kind": "function", |
145 | | - "line": 2676, |
| 145 | + "line": 2682, |
146 | 146 | "metadata": { |
147 | 147 | "api_refs": [ |
148 | 148 | "policyengine_us_data.datasets.cps.cps.add_org_labor_market_inputs" |
|
169 | 169 | "docstring": "Add income variables.\n\nArgs:\n cps (h5py.File): The CPS dataset file.\n person (DataFrame): The CPS person table.\n year (int): The CPS year", |
170 | 170 | "id": "add_personal_income_variables", |
171 | 171 | "kind": "function", |
172 | | - "line": 1139, |
| 172 | + "line": 1137, |
173 | 173 | "metadata": { |
174 | 174 | "api_refs": [ |
175 | 175 | "policyengine_us_data.datasets.cps.cps.add_personal_income_variables" |
|
196 | 196 | "docstring": "Add personal demographic variables.\n\nArgs:\n cps (h5py.File): The CPS dataset file.\n person (DataFrame): The CPS person table.", |
197 | 197 | "id": "add_personal_variables", |
198 | 198 | "kind": "function", |
199 | | - "line": 995, |
| 199 | + "line": 993, |
200 | 200 | "metadata": { |
201 | 201 | "api_refs": [ |
202 | 202 | "policyengine_us_data.datasets.cps.cps.add_personal_variables" |
|
223 | 223 | "docstring": "", |
224 | 224 | "id": "add_previous_year_income", |
225 | 225 | "kind": "function", |
226 | | - "line": 1496, |
| 226 | + "line": 1502, |
227 | 227 | "metadata": { |
228 | 228 | "api_refs": [ |
229 | 229 | "policyengine_us_data.datasets.cps.cps.add_previous_year_income" |
|
277 | 277 | "docstring": "", |
278 | 278 | "id": "add_spm_variables", |
279 | 279 | "kind": "function", |
280 | | - "line": 1415, |
| 280 | + "line": 1423, |
281 | 281 | "metadata": { |
282 | 282 | "api_refs": [ |
283 | 283 | "policyengine_us_data.datasets.cps.cps.add_spm_variables" |
|
304 | 304 | "docstring": "Assign SSN card type using PRCITSHP, employment status, and ASEC-UA conditions.\nCodes:\n- 0: \"NONE\" - Likely undocumented immigrants\n- 1: \"CITIZEN\" - US citizens (born or naturalized)\n- 2: \"NON_CITIZEN_VALID_EAD\" - Non-citizens with work/study authorization\n- 3: \"OTHER_NON_CITIZEN\" - Non-citizens with indicators of legal status", |
305 | 305 | "id": "add_ssn_card_type", |
306 | 306 | "kind": "function", |
307 | | - "line": 1602, |
| 307 | + "line": 1608, |
308 | 308 | "metadata": { |
309 | 309 | "api_refs": [ |
310 | 310 | "policyengine_us_data.datasets.cps.cps.add_ssn_card_type" |
|
331 | 331 | "docstring": "", |
332 | 332 | "id": "add_takeup", |
333 | 333 | "kind": "function", |
334 | | - "line": 476, |
| 334 | + "line": 474, |
335 | 335 | "metadata": { |
336 | 336 | "api_refs": [ |
337 | 337 | "policyengine_us_data.datasets.cps.cps.add_takeup" |
|
358 | 358 | "docstring": "", |
359 | 359 | "id": "add_tips", |
360 | 360 | "kind": "function", |
361 | | - "line": 2501, |
| 361 | + "line": 2507, |
362 | 362 | "metadata": { |
363 | 363 | "api_refs": [ |
364 | 364 | "policyengine_us_data.datasets.cps.cps.add_tips" |
|
810 | 810 | "docstring": "Replace clone-half person-level feature variables with donor matches.", |
811 | 811 | "id": "clone_features", |
812 | 812 | "kind": "function", |
813 | | - "line": 403, |
| 813 | + "line": 404, |
814 | 814 | "metadata": { |
815 | 815 | "api_refs": [ |
816 | 816 | "policyengine_us_data.datasets.cps.extended_cps._splice_clone_feature_predictions" |
|
873 | 873 | "docstring": "Assert that final exported variables are leaf inputs.", |
874 | 874 | "id": "computed_export_contract", |
875 | 875 | "kind": "function", |
876 | | - "line": 1266, |
| 876 | + "line": 1267, |
877 | 877 | "metadata": { |
878 | 878 | "api_refs": [ |
879 | 879 | "policyengine_us_data.datasets.cps.extended_cps.ExtendedCPS._assert_no_computed_variables_exported" |
|
967 | 967 | "docstring": "Second-stage QRF: train on CPS, predict for PUF clones.\n\nFor the PUF clone half of the extended CPS we need plausible values\nof CPS-only variables (retirement distributions, transfers, hours,\nSPM components, etc.) that are consistent with the clone's\nPUF-imputed income -- not just naively copied from the CPS donor.\n\nWe train a QRF on CPS person-level data where:\n * predictors = demographics + key income variables\n * outputs = CPS-only variables listed in\n ``CPS_ONLY_IMPUTED_VARIABLES``\n\nFor PUF clone prediction we use the PUF-imputed income values\nfrom the second half of ``data`` (the clone half, which already\nhas PUF-imputed income from stage 1).\n\nUses ``fit_predict()`` with ``max_train_samples`` instead of\nmanual sampling + separate fit/predict.\n\nArgs:\n data: Extended dataset dict after ``puf_clone_dataset()`` --\n already doubled, with PUF-imputed income in the second half.\n time_period: Tax year.\n dataset_path: Path to the CPS h5 file for Microsimulation.\n\nReturns:\n DataFrame with one column per CPS-only variable, containing\n predicted values for the PUF clone half (person-level).", |
968 | 968 | "id": "cps_only", |
969 | 969 | "kind": "function", |
970 | | - "line": 442, |
| 970 | + "line": 443, |
971 | 971 | "metadata": { |
972 | 972 | "api_refs": [ |
973 | 973 | "policyengine_us_data.datasets.cps.extended_cps._impute_cps_only_variables" |
|
2619 | 2619 | "docstring": "Replace PUF clone half of CPS-only variables with QRF predictions.\n\nAfter ``puf_clone_dataset()`` the CPS-only variables in the second\nhalf are naive copies of the CPS donor values. This function\nreplaces them with the second-stage QRF predictions that are\nconsistent with the clone's PUF-imputed income.\n\nArgs:\n data: Extended dataset dict (already doubled).\n predictions: DataFrame from ``_impute_cps_only_variables()``.\n time_period: Tax year.\n dataset_path: Path to CPS h5 file for entity mapping.\n\nReturns:\n Modified data dict with CPS-only variables spliced in.", |
2620 | 2620 | "id": "qrf_pass2", |
2621 | 2621 | "kind": "function", |
2622 | | - "line": 748, |
| 2622 | + "line": 749, |
2623 | 2623 | "metadata": { |
2624 | 2624 | "api_refs": [ |
2625 | 2625 | "policyengine_us_data.datasets.cps.extended_cps._splice_cps_only_predictions" |
|
2735 | 2735 | "docstring": "", |
2736 | 2736 | "id": "reweight", |
2737 | 2737 | "kind": "function", |
2738 | | - "line": 504, |
| 2738 | + "line": 486, |
2739 | 2739 | "metadata": { |
2740 | 2740 | "api_refs": [ |
2741 | 2741 | "policyengine_us_data.datasets.cps.enhanced_cps.reweight" |
|
0 commit comments