Skip to content

Commit

Permalink
Merge pull request #11 from PolicyEngine/imputations
Browse files Browse the repository at this point in the history
Adjust imputation behaviour
  • Loading branch information
nikhilwoodruff authored Sep 16, 2024
2 parents 6a1e5c1 + fcd571f commit 5426115
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions policyengine_uk_data/datasets/frs/enhanced_frs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class EnhancedFRS(Dataset):
def generate(self):
data = self.input_frs().load_dataset()
data = self.input_frs(require=True).load_dataset()
original_weights = data["household_weight"][str(self.time_period)] + 10
for year in range(self.time_period, self.end_year + 1):
loss_matrix, targets_array = create_target_matrix(
Expand Down Expand Up @@ -100,5 +100,4 @@ def loss(weights):


if __name__ == "__main__":
ReweightedFRS_2022_23().generate()
EnhancedFRS_2022_23().generate()
2 changes: 1 addition & 1 deletion policyengine_uk_data/utils/imputations/capital_gains.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def loss(blend_factor):
loss_value.backward()
optimiser.step()
progress.set_description(f"Loss: {loss_value.item()}")
if loss_value.item() < 1e-5:
if loss_value.item() < 1e-3:
break

new_household_weight = household_weight.detach().numpy()
Expand Down

0 comments on commit 5426115

Please sign in to comment.