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

Extend test coverage for non-conventional booleans #2601

Merged
merged 2 commits into from
Oct 6, 2022

Conversation

jppgks
Copy link
Contributor

@jppgks jppgks commented Oct 5, 2022

Tests for non-conventional binary feature that

  1. true/false labels are inferred correctly when fallback_true_label is provided
  2. a warning is logged in case no fallback_true_label is provided
  3. AutoML treats them as CATEGORY

@github-actions
Copy link

github-actions bot commented Oct 5, 2022

Unit Test Results

         4 files  ±  0         4 suites  ±0   2h 4m 3s ⏱️ + 4m 33s
  3 438 tests +  8  3 362 ✔️ +10    76 💤  - 2  0 ±0 
10 032 runs  +20  9 823 ✔️ +22  209 💤  - 2  0 ±0 

Results for commit de54948. ± Comparison against base commit f81d29f.

♻️ This comment has been updated with latest results.

Comment on lines 486 to 493
warning_text = re.compile(
f"Binary feature {bin_feature[NAME]} has at least 1 unconventional boolean value:"
r" Cannot automatically map value '(>50K|<=50K)'"
" to a boolean and no `preprocessing.fallback_true_label` specified."
" We will now interpret <=50K as 1 and the other values as 0. If this is incorrect, please use the category"
" feature type or manually specify the true value with `preprocessing.fallback_true_label`."
)
assert re.search(warning_text, caplog.text) is not None
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend against checking on such a specific regex. If at any point someone changes the text of the warning, then they have to also update this test.

Maybe check against "*unconventional boolean value"

@jppgks jppgks merged commit f6811c0 into master Oct 6, 2022
@jppgks jppgks deleted the non-conventional-bools branch October 6, 2022 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants