Skip to content

Commit

Permalink
Combine adjusted and imputed values to one column (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonZogk authored Oct 7, 2024
1 parent 099426e commit 9c6d585
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ def get_qa_output_482(post_win_df):
'default_link_f_match_adjusted_value','b_link_adjusted_value',
'b_match_adjusted_value_pair_count','default_link_b_match_adjusted_value',
'construction_link', 'flag_construction_matches_pair_count','default_link_flag_construction_matches',
"imputed_value","constrain_marker" # these not requested but usefull
"constrain_marker" # these not requested but usefull
]

# not part of the pipeline the below
post_win_df['total weight (A*G*O)'] = post_win_df['design_weight']*post_win_df['calibration_factor']*post_win_df['outlier_weight']

post_win_df['weighted adjusted value'] =post_win_df['imputed_value'] * post_win_df['total weight (A*G*O)']
post_win_df['weighted adjusted value'] =post_win_df['adjusted_value'] * post_win_df['total weight (A*G*O)']


return post_win_df[requested_columns]
Expand Down
7 changes: 7 additions & 0 deletions testing_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@

post_constrain = constrain(post_impute,"period","reference","adjusted_value","imputed_value","question_no","form_type_spp")

# Winsorise and outputs expect return value and impute to be on same column
post_constrain["adjusted_value"] = post_constrain[["adjusted_value", "imputed_value"]].agg(
sum, axis=1)

post_constrain.drop(columns=["imputed_value"], inplace=True)


check_na_duplicates(post_constrain) #just basic check

# Imputation test data here
Expand Down

0 comments on commit 9c6d585

Please sign in to comment.