Fix simple feature integration tests. #1419
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main changes:
#2
was inspired by gettingtest_category_int_dtype
to pass.Unlike tensorflow's metrics libraries, the design of
torchmetrics
seems to be to throw an exception if it receives "bad" input. In this case, torch'sroc_auc
metric complains if the giventargets
have all positive or all negative targets.The synthetic de-duped data size for the
test_category_int_dtype
unit test is ~18, and with the default(0.7, 0.1, 0.2)
split, it's likely that the validation set (size=2) or test set (size=4) have allTrue
or allFalse
targets, which triggers this exception.While this phenomenon is unlikely to occur on "real" data, it seems reasonable to simply skip computing the metric in the "rare" instance that
torchmetrics
throws an error.The metrics summary table would render like so, and we can check logs for the specific exception.