Conversation
| X, y = [[0.0], [1.0]], [0, 1] | ||
|
|
||
| msg = ("The default gamma parameter value 'auto', calculated as 1 / n_features," | ||
| " is depreciated in version 0.19 and will be replaced by 'scale'," |
There was a problem hiding this comment.
we use "deprecated" not "depreciated"
|
|
||
| clf = svm.SVC(gamma='scale').fit(X, y) | ||
| assert_equal(clf._gamma, 2.0) | ||
|
No newline at end of file |
There was a problem hiding this comment.
there should be a newline at the end fo the file.
| X, y = [[0.0], [1.0]], [0, 1] | ||
|
|
||
| clf = svm.SVC(gamma='scale').fit(X, y) | ||
| assert_equal(clf._gamma, 2.0) |
There was a problem hiding this comment.
please check for more than one X
|
|
||
| assert_warns_message(DeprecationWarning, | ||
| msg, | ||
| svm.SVC(gamma='auto').fit, X, y) |
There was a problem hiding this comment.
But this means that a user can't intentionally pass 'auto' without receiving a warning, which isn't great. We could solve this by making the default actually 'auto_deprecated' which behaves like 'auto' with a warning. Using 'auto' explicitly would be same without warning.
| random_state=rng) | ||
|
|
||
| for base_estimator in [DecisionTreeClassifier(), SVC()]: | ||
| for base_estimator in [DecisionTreeClassifier(), SVC(gamma="scale")]: |
|
@neokt are you working on completing this? I just learnt about SVM's so, I can try to get this complete on top of your commits, if you don't plan on working on this. |
|
Thanks for the heads up. I'll try complete it. |
Reference Issue
Addresses #8361
What does this implement/fix? Explain your changes.
Deprecates the default SVC gamma parameter value of "auto", which is calculated as 1 / n_features, and introduces "scale", which is calculated as 1 / (n_features * X.std()).
Any other comments?
Could not run nosetests due to problems with Conda environent. There are potentially other occurrences of SVC() that need to be updated to SVC(gamma="scale") to avoid Deprecation Warnings associated with SVC(gamma = "auto"). Submitting pull request to locate errors.