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

Handle threshold_match_probablity 0 in predict() #2420 #2425

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Changes from 2 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
4 changes: 3 additions & 1 deletion splink/internals/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def predict_from_comparison_vectors_sqls(
bf_terms,
sql_infinity_expression,
)

# Add condition to treat case of 0 as None
if threshold_match_probability == 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's whitespace at the end of these lines at the moment hence ruff is failing.

Really the best solution is to process using ruff, but removing the whitespace manually should do it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, yeah sorry i thought I'd fixed that let me have another look

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should have done it now, it was on line 102, sorry im very new to this stuff.

threshold_match_probability = None
# In case user provided both, take the minimum of the two thresholds
if threshold_match_probability is not None:
thres_prob_as_weight = prob_to_match_weight(threshold_match_probability)
Expand Down
Loading