Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion policyengine_uk_data/datasets/frs/frs.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ def add_benefit_income(
benefits.person_id,
person.index,
)
* 52
* 52
)

frs["winter_fuel_allowance_reported"] = (
Expand Down
3 changes: 3 additions & 0 deletions policyengine_uk_data/utils/imputations/capital_gains.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,12 @@ def loss(blend_factor):
lower = row.minimum_total_income
upper = row.maximum_total_income
ti_in_range = (ti >= lower) * (ti < upper)
print(has_cg.mean(), ti_in_range.mean())
in_target_range = has_cg * ti_in_range
print(in_target_range.sum(), in_target_range.mean())
quantiles = np.random.random(int(in_target_range.sum()))
pred_capital_gains = spline(quantiles)
print(pred_capital_gains)
new_cg[in_target_range] = pred_capital_gains

return new_cg, new_household_weight
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies = [
"google-cloud-storage",
"google-auth",
"uk-public-services-imputation",
"scipy==1.12.0",
]

[project.optional-dependencies]
Expand Down
Loading