| name | l0 |
| description | L0 regularization for neural network sparsification and intelligent sampling - used in survey calibration |
L0 Regularization
L0 is a PyTorch implementation of L0 regularization for neural network sparsification and intelligent sampling, used in PolicyEngine's survey calibration pipeline.
For Users 👥
What is L0?
L0 regularization helps PolicyEngine create more efficient survey datasets by intelligently selecting which households to include in calculations.
Impact you see:
- Faster population impact calculations
- Smaller dataset sizes
- Maintained accuracy with fewer samples
Behind the scenes:
When PolicyEngine shows population-wide impacts, L0 helps select representative households from the full survey, reducing computation time while maintaining accuracy.
For Analysts 📊
What L0 Does
L0 provides intelligent sampling gates for:
- Household selection - Choose representative samples from CPS
- Feature selection - Identify important variables
- Sparse weighting - Create compact, efficient datasets
Used in PolicyEngine for:
- Survey calibration (via microcalibrate)
- Dataset sparsification in policyengine-us-data
- Efficient microsimulation
Installation
pip install l0-python
Quick Example: Sample Selection
from l0 import SampleGate
gate = SampleGate(n_samples=10000, target_samples=)
selected_data, indices = gate.select_samples(data)