-
Notifications
You must be signed in to change notification settings - Fork 540
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
Fix SVM model parameter handling in case n_support=0 #4097
Fix SVM model parameter handling in case n_support=0 #4097
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code lgtm
There is an unrelated failure in umap test_umap_mnmg. |
rerun tests |
Codecov Report
@@ Coverage Diff @@
## branch-21.08 #4097 +/- ##
===============================================
Coverage ? 85.81%
===============================================
Files ? 231
Lines ? 18269
Branches ? 0
===============================================
Hits ? 15677
Misses ? 2592
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
@gpucibot merge |
Fixes rapidsai#4033 This PR fixes SVM model parameter handling in case the fitted model has no support vectors, only bias. C++ side changes: - The bias calculation is updated to calculate the bias as the average function value in this case. - The prediction function is modified to avoid kernel function calculation in this case. - Added an SVR unit test to check model fitting and prediction. Python side changes: - It was incorrectly assumed that n_support==0 means the model is not fitted correctly, this is removed. - Model attributes (`dual_coef_`, `support_`, `support_vectors_`) are defined as empty arrays in this case. - `coef_` attribute is an array of zeros if there are no support vectors. - Unit test added to check training prediction and model attributes. Authors: - Tamas Bela Feher (https://github.com/tfeher) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) URL: rapidsai#4097
Fixes #4033
This PR fixes SVM model parameter handling in case the fitted model has no support vectors, only bias.
C++ side changes:
Python side changes:
dual_coef_
,support_
,support_vectors_
) are defined as empty arrays in this case.coef_
attribute is an array of zeros if there are no support vectors.