-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ENH] test classifiers on str dtype y
, ensure predict
returns same type and labels
#6428
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fkiraly
added
module:classification
classification module: time series classification
enhancement
Adding new functionality
labels
May 15, 2024
fkiraly
requested review from
achieveordie,
benHeid and
yarnabrina
as code owners
May 15, 2024 21:54
Recognizes Will now merge the fix #6430 to check that it fixes all remaining failures covered by this addition. |
3 tasks
1 task
fkiraly
added a commit
that referenced
this pull request
May 22, 2024
…ing `y` of different type in `predict` (#6432) Towards #6431. Fixes `ProximityForest`, tree, stump, and `IndividualBOSS` returning `y` of different type in `predict`. The `IndividualBOSS` was coercing to `object` which was turned of. The proximity classifiers had `_predict` being copy-paste of the default `_predict` which was fixed in #6430. The fix is deduplication, so the `_predict` defaults to the fixed parent classes' predict. Tested via #6428
fkiraly
added a commit
that referenced
this pull request
May 22, 2024
…ys, even if `fit` `y` was not integer (#6430) This fixes one of the bugs reported in #6427, namely the default `_predict` in `BaseClassifier` always returning integer labels, even if the original labels were not integers. This would cause all classifiers that did not have a custom `_predict` implemented - a few composites, among them `BaggingClassifier` - to always predict integers, even if the `y` seen in `fit` was of another type. The fix is simple, adding a missing application of the memorized integer-to-class dictionary. Test coverage is through #6428.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Adding new functionality
module:classification
classification module: time series classification
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.
This PR extends the suite test
test_classifier_on_unit_test_data
to test thaty
of object or str dtypey
leads to correct labels onpredict
outputs.Covers second bug in #6427, namely the example returning integer labels instead of string labels - but does not fix the bug.
It is hence expected that the test will detect bug #6427.
Depends on the following PR which fix newly covered bugs:
_predict
returning integer labels always, even iffit
y
was not integer #6430ProximityForest
, tree, stump, andIndividualBOSS
returningy
of different type inpredict
#6432