Skip to content

Conversation

@baogorek
Copy link
Collaborator

@baogorek baogorek commented Jul 14, 2025

Closes #197 , Closes #356 refences L1 but I think this is in the spirit of it)

@baogorek baogorek marked this pull request as ready for review July 16, 2025 02:34
Copy link
Collaborator

@juaristi22 juaristi22 left a comment

Choose a reason for hiding this comment

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

Nice! Excited to see what this dataset can do!

@baogorek baogorek requested a review from juaristi22 July 16, 2025 13:25
@nikhilwoodruff
Copy link
Contributor

nikhilwoodruff commented Jul 16, 2025

Thanks!! But a bit paranoid of course about this new dataset. Can you add to this PR:

  • Details of the JCT tax expenditure tests/rough sense check of the calibration scores
  • How the score of the OBBBA changes (net cost, winner/loser shares, total net cost among filers with >1m AGI)
  • Number of household observations (nonzero weights) per decile (so we know if the decile impacts are not going to get super weird/noisy)

All of the above compared to the regular ECPS before this PR.

@PavelMakarchuk can you share 3 policy jsons/structural reforms that @baogorek can run, along with expected revenue numbers.

@baogorek
Copy link
Collaborator Author

@nikhilwoodruff I copied over all the tests that the ecps has to pass, and it passed all but one. The one it failed on was;

SSN card type "NONE" count: 0, target: 13000000, error: 100.00% 

So I suppose this sparse solution happened not to include anyone with NONE for ssn_card_type. How big of a deal do you think that is?

FYI, I made the threshold in the test very large so it would pass and log it out, so eventually I need to fix that.

The calibration log looks pretty good!
calibration_log_sparse.csv

@MaxGhenis
Copy link
Contributor

Given the extent to which OBBBA affects the estimated 13 million undocumented immigrants, I think it's problematic to report that zero exist.

@nikhilwoodruff
Copy link
Contributor

OK @baogorek could you increase the number til we don't hit this error?

@MaxGhenis
Copy link
Contributor

How many records in this dataset?

@baogorek
Copy link
Collaborator Author

@nikhilwoodruff , @MaxGhenis I'm passing all tests, including the ssn_card_type test with the original threshold (see starting at line 150 of policyengine_us_data/tests/test_datasets/test_sparse_enhanced_cps.py). There are 5,971 non-zero weights in this run, as can be seen at the end of the build data sets log. There is some non-determinism and I've seen the loss go lower locally, so I could investigate that, or just double the number of epochs for the final run.

@baogorek baogorek requested a review from MaxGhenis July 17, 2025 17:25
Copy link
Contributor

@MaxGhenis MaxGhenis left a comment

Choose a reason for hiding this comment

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

Good to see that epochs and other hyperparameters solved it

@baogorek
Copy link
Collaborator Author

baogorek commented Jul 18, 2025

@nikhilwoodruff this is passing all of the tests that the ordinary ecps is passing (the previous failure was due to not storing enums correctly in the h5). Is this enough to go through with this as a sparse MVP? If I need to test with OBBBA reforms, @PavelMakarchuk , I will need your help. There are slightly over 5k households in this sparse dataset, which is enough to estimate the ssn card type == "NONE" total within the original accuracy thresholds. I believe this model is solid.

@nikhilwoodruff
Copy link
Contributor

OK LGTM. We have dataset versioning anyway. Let's merge

@nikhilwoodruff nikhilwoodruff merged commit 8025184 into main Jul 18, 2025
7 checks passed
@nikhilwoodruff nikhilwoodruff deleted the bogorek-l0 branch July 18, 2025 12:43
juaristi22 pushed a commit that referenced this pull request Jul 18, 2025
* initial commit of L0 branch

* Add HardConcrete L0 regularization

* l0 example completed

* removing commented code

* pre lint cleanup

* post-lint cleanup

* Refactor reweighting diagnostics

* removed _clean from names in the reweighting function

* modifying print function and test

* Convert diagnostics prints to logging

* removing unused variable

* setting high tolerance for ssn test just to pass

* linting

* fixed data set creation logic. Modified parameters

* docs. more epochs
nikhilwoodruff added a commit that referenced this pull request Jul 18, 2025
* Use normal runner in PR tests

* added the 3.11.12 pin

* cps.py

* adding diagnostics

* lint

* taking out bad targets

* fixing workflow arg passthrough

* deps and defaults

* wrong pipeline for manual test

* trying again to get the manual test to work

* reverting to older workflow code

* cleaning up enhanced_cps.py

* Update package version

* removing github download option. Switching to hugging face downloads

* changelog entry

* reverting the old code changes workflow

* Update package version

* start cleaning calibration targets

* add us package to dependencies

* update csv paths in tests too

* manual test

* pr

* updates

* trying to get the right workflow to run

* taking out the token

* ready for review

* Update package version

* adding diagnostics

* taking out bad targets

* fixing workflow arg passthrough

* wrong pipeline for manual test

* Update package version

* removing github download option. Switching to hugging face downloads

* reverting the old code changes workflow

* remove districting file

* remove duplications from merge with main

* add changelog_entry

* Add L0 Regularization, make a better small ECPS (#364)

* initial commit of L0 branch

* Add HardConcrete L0 regularization

* l0 example completed

* removing commented code

* pre lint cleanup

* post-lint cleanup

* Refactor reweighting diagnostics

* removed _clean from names in the reweighting function

* modifying print function and test

* Convert diagnostics prints to logging

* removing unused variable

* setting high tolerance for ssn test just to pass

* linting

* fixed data set creation logic. Modified parameters

* docs. more epochs

* Update package version

* Pin microdf

* adding diagnostics

* taking out bad targets

* Update package version

* start cleaning calibration targets

* trying to get the right workflow to run

* ready for review

* taking out bad targets

* restore changes lost when merging with main

* more cleanup

* even more cleanup

* fix file paths in new sparse ecps test

* lint

* fixing merge

---------

Co-authored-by: Nikhil Woodruff <35577657+nikhilwoodruff@users.noreply.github.com>
Co-authored-by: baogorek <baogorek@gmail.com>
Co-authored-by: MaxGhenis <MaxGhenis@users.noreply.github.com>
Co-authored-by: baogorek <baogorek@users.noreply.github.com>
Co-authored-by: nikhilwoodruff <nikhilwoodruff@users.noreply.github.com>
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.

Reduce dataset size with {L1 penalty, loss contribution calculations} Apply L0 penalty

5 participants