diff --git a/splink/analyse_blocking.py b/splink/analyse_blocking.py index c63208bd4d..9c2eb4fed6 100644 --- a/splink/analyse_blocking.py +++ b/splink/analyse_blocking.py @@ -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)." ) diff --git a/splink/files/chart_defs/blocking_rule_generated_comparisons.json b/splink/files/chart_defs/blocking_rule_generated_comparisons.json index e0d709a6bc..9aa35d49c0 100644 --- a/splink/files/chart_defs/blocking_rule_generated_comparisons.json +++ b/splink/files/chart_defs/blocking_rule_generated_comparisons.json @@ -59,7 +59,7 @@ "format": "," }, { - "type": "quantitative", + "type": "nominal", "field": "reduction_ratio", "title": "Reduction Ratio (cumulative rows/cartesian product)" } diff --git a/splink/linker.py b/splink/linker.py index 28845adb6a..d1859284d4 100644 --- a/splink/linker.py +++ b/splink/linker.py @@ -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 >>> ) @@ -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 >>> )