Combine and expose SVC's support vectors when fitting multi-class data - #4454
Merged
rapids-bot[bot] merged 7 commits intoJan 28, 2022
Merged
Conversation
wphicks
approved these changes
Dec 16, 2021
wphicks
left a comment
Contributor
There was a problem hiding this comment.
Looks good! You'll need to take care of some style stuff reported by the linter, but otherwise this seems great. Had just one question for my own edification but not a blocker for merging.
|
This PR has been labeled |
Contributor
|
rerun test |
Contributor
|
Stylistic changes LGTM. I think we're good to merge as soon as we know what's up with CI. |
Contributor
|
rerun tests |
Contributor
|
@gpucibot merge |
cjnolet
added a commit
to cjnolet/cuml
that referenced
this pull request
Feb 4, 2022
…lass data (NVIDIA#4454)" This reverts commit abae602.
vimarsh6739
pushed a commit
to vimarsh6739/cuml
that referenced
this pull request
Oct 9, 2023
NVIDIA#4454) The purpose of this PR is to resolve issue NVIDIA#4206; filling SVC's `support_` attribute by combining the support_ attribute from each of the estimators used in a multi-class one-versus-one SVC fit. This is a new PR, now updated to be current with branch-21.12; this replaces [this PR](NVIDIA#4308), [this PR](NVIDIA#4218) and [this PR](NVIDIA#4305), all of which have now been closed. This change will allow libraries that rely on sklearn's SVC attribute `support_`, [like imbalanced-learn](https://github.com/scikit-learn-contrib/imbalanced-learn/blob/56eefdf3d92afca77bc16fc13d315db5287df2fa/imblearn/over_sampling/_smote/filter.py#L366), to utilize cuML's SVC in place of sklearn's SVC. In order to properly fill the `support_` indices, we must first extract the `support_` indices from each estimator in the multi-class wrapper. Then, these indices must be aligned with the full multi-class dataset, as each estimator only receives a binary (ovo) dataset that has certain classes removed by the multi-class wrapper. [Here is a gist](https://gist.github.com/NV-jpt/48c324cd2cf3b972af32c2913f6c1b35) that displays and compares the behavior of cuml with these changes to that of sklearn (prior to the changes in this PR, `clf_cuml.support_` simply returned `None`). Authors: - https://github.com/NV-jpt - Dante Gama Dessavre (https://github.com/dantegd) Approvers: - William Hicks (https://github.com/wphicks) URL: NVIDIA#4454
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The purpose of this PR is to resolve issue #4206; filling SVC's
support_attribute by combining the support_ attribute from each of the estimators used in a multi-class one-versus-one SVC fit.This is a new PR, now updated to be current with branch-21.12; this replaces this PR, this PR and this PR, all of which have now been closed.
This change will allow libraries that rely on sklearn's SVC attribute
support_, like imbalanced-learn, to utilize cuML's SVC in place of sklearn's SVC.In order to properly fill the
support_indices, we must first extract thesupport_indices from each estimator in the multi-class wrapper. Then, these indices must be aligned with the full multi-class dataset, as each estimator only receives a binary (ovo) dataset that has certain classes removed by the multi-class wrapper.Here is a gist that displays and compares the behavior of cuml with these changes to that of sklearn (prior to the changes in this PR,
clf_cuml.support_simply returnedNone).