-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Issue #19614: Warn on irrelevant parameters for linear kernel in SVC #28641
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
base: main
Are you sure you want to change the base?
Conversation
❌ Linting issuesThis PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling You can see the details of the linting issues under the
|
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.
Thanks for the PR @Issac-Kondreddy. There are linting issues that you can fix following the instructions in #28641 (comment).
self.classes_ = np.unique(y) | ||
if self.kernel == 'linear': | ||
if self.gamma not in ('scale', 'auto'): |
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.
Let's warn for all non-default values
if self.gamma not in ('scale', 'auto'): | |
if self.gamma != "scale": |
@Issac-Kondreddy let me know if you're still working on this. Otherwise would be happy to take this on. |
This PR will also close #19630; in fact it's a bit of a duplicate to it. |
I assume that this PR is stalled and proposed a new PR to fix linting issues |
Fixes #XXXX
This pull request addresses the issue raised in #19614, where
SVC
does not warn users when irrelevant parameters (gamma
,coef0
,degree
) are set for thelinear
kernel. Such parameters have no effect and can mislead users, especially those new to SVM or scikit-learn.Changes Made:
svm/_classes.py
to issue warnings whengamma
,coef0
, ordegree
is set to non-default values while using alinear
kernel.Rationale:
The changes improve user feedback and contribute to a more intuitive user experience by notifying users of potentially unintended parameter configurations. This approach follows scikit-learn's principles of transparency and user-friendliness in machine learning model configuration.