Open
Description
During our class we noticed some students incorrectly configure some hyperparameters which are irrelevant to the kernel used, for example setting gamma
when using a linear kernel. We think it could make sense for scikit-learn to give feedback to the user when non-effective settings are configured.
Describe the workflow you want to enable
from sklearn.datasets import load_iris
from sklearn.svm import SVC
x, y = load_iris(return_X_y=True)
clf = SVC(kernel='linear', gamma=1e-6)
clf.fit(x, y)
print(clf.score(x, y))
current output:
0.9933333333333333
proposed output, something similar to:
UserWarning: Gamma is set but not used because a linear kernel is configured.
0.9933333333333333