[MRG] Change loss names for LinearSVC and LinearSVR#3933
[MRG] Change loss names for LinearSVC and LinearSVR#3933larsmans merged 1 commit intoscikit-learn:masterfrom
Conversation
|
The implementation is backwards compatible, so that the user can still use loss={'l1', 'l2'} in LinearSVC |
|
Can you add a test for |
There was a problem hiding this comment.
I'm having a hard parsing the meaning of this... care to insert a comment explaining the structure?
|
I guess we should deprecate the old names then? Is that consistent with SGDClassifier? |
|
Or we don't deprecate, and we leave them in-place forever as backwards-compatible synonyms. They're not in the way, are they? |
|
Fine with me, but then they should be documented, right? |
|
I agree it should be documented, I'll take care of it (and the failing tests). |
3a5b451 to
3f25c73
Compare
|
Fixed the failing test (mostly due to error in doctests). Ready to merge I would say |
|
+1 for merge. I've already cherry-picked the last commit into master. |
sklearn/svm/classes.py
Outdated
There was a problem hiding this comment.
we that's why we shouldn't do it in the init method ;) actually the common tests should fail if you do it in the __init__. Do they not? The deprecation warning should give the version (0.17?) where it will be removed.
There was a problem hiding this comment.
Ohh, missed this one. I too think we should do this in fit and not actually store the translated loss name. Just make sure l1 and hinge cause the same behavior.
f9852a5 to
d49a935
Compare
|
👍 |
|
Ehm... it still says the old names are going to disappear in 0.17. Can we really not keep them indefinitely? Or remove in version 1.0 or something? |
|
I really don't mind in what version to deprecate. 1.0 is fine for me. |
|
Changed the removal version to 1.0 |
|
Fine with me. This PR needs a rebase though. |
bc76ecf to
b56f7e5
Compare
the names are now consistent across methods In LinearSVC: 'l1' -> 'hinge' 'l2' -> 'squared_hinge' In LinearSVR: 'l1' -> 'epsilon_insensitive' 'l2' -> 'squared_epsilon_insensitive'
b56f7e5 to
dbc5d70
Compare
|
Rebase done |
MAINT Change loss names for LinearSVC and LinearSVR
|
Merged. |
the names are now consistent across methods and with the SGD module
In LinearSVC:
'l1' -> 'hinge'
'l2' -> 'squared_hinge'
In LinearSVR:
'l1' -> 'epsilon_insensitive'
'l2' -> 'squared_epsilon_insensitive'