-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iterative categorical matching #60
Conversation
Adding notes from discussion to check and implement, then can merge (happy to do both these):
|
The new
# Define required columns for matching
required_columns_fixed = [
"number_adults",
"number_children",
"number_cars",
"num_pension_age",
"rural_urban_2_categories",
]
# Define optional columns in order of importance (most to least important)
optional_columns_fixed = []
# # Match using iterative matching
matcher_fixed = MatcherExact(
df_pop=spc_matching,
df_pop_id="hid",
df_sample=nts_matching,
df_sample_id="HouseholdID",
matching_dict = matching_dfs_dict,
fixed_cols=required_columns_fixed,
optional_cols=optional_columns_fixed,
n_matches=0,
chunk_size=50000,
show_progress=True,
)
matches_hh_level_fixed = matcher_fixed.iterative_match_categorical() |
|
…eater-london Modifications for Greater London (#58)
} | ||
assert result == expected_result | ||
|
||
|
||
@pytest.mark.skip(reason="todo") | ||
def test_match_individuals(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to have the test fixture and tests added here. Perhaps we can add a test for the match_psm
too using this in a subsequent PR, I'll open an issue for this.
Thanks for adding this @Hussein-Mahfouz, this looks great with the matching algorithm clearer, configurable and tested. As discussed, I'll go ahead and merge this now following running for Greater London as part of #58. |
As described in #13