Skip to content
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

Cumulative BRs - minor tweaks to fix documentation and rr error #974

Merged
merged 1 commit into from
Jan 16, 2023
Merged
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
5 changes: 3 additions & 2 deletions splink/analyse_blocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ def cumulative_comparisons_generated_by_blocking_rules(
if output_chart:

cumulative_sum += row
rr = round(calculate_reduction_ratio(cumulative_sum, cartesian), 3)
# Increase round threshold to capture more info on larger datasets
rr = round(calculate_reduction_ratio(cumulative_sum, cartesian), 6)

rr_text = (
"The rolling reduction ratio with your given blocking rule(s) "
f"is {rr}. \nThis represents the reduction in the total number "
f"is {rr}. This represents the reduction in the total number "
"of comparisons due to your rule(s)."
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"format": ","
},
{
"type": "quantitative",
"type": "nominal",
"field": "reduction_ratio",
"title": "Reduction Ratio (cumulative rows/cartesian product)"
}
Expand Down
4 changes: 2 additions & 2 deletions splink/linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,7 @@ def cumulative_comparisons_from_blocking_rules_records(
>>> and substr(l.dob,1,4) = substr(r.dob,1,4)"
>>> ]
>>>
>>> linker.cumulative_comparisons_from_blocking_rules_records(
>>> linker_settings.cumulative_comparisons_from_blocking_rules_records(
>>> blocking_rules
>>> )

Expand Down Expand Up @@ -2105,7 +2105,7 @@ def cumulative_num_comparisons_from_blocking_rules_chart(
>>> and substr(l.dob,1,4) = substr(r.dob,1,4)"
>>> ]
>>>
>>> linker.cumulative_num_comparisons_from_blocking_rules_chart(
>>> linker_settings.cumulative_num_comparisons_from_blocking_rules_chart(
>>> blocking_rules
>>> )

Expand Down