Repository navigation
MRG: SGDClassifier.predict_proba shape - #1030
Conversation
|
I'm +1 on doing this but not everybody is, so let's wait ;) |
|
+1 for merge. I think everybody agrees with the fact that predict_proba should return a proba for each class. The problem is more with decision_function. |
|
I think @mblondel disagreed and I think he raised a vaild point. |
|
I'm +1 on principle but my only worry is that SGDClassifier(loss="log") is quite popular so this will break user code. |
|
I'd like to hear @GaelVaroquaux opinion when he comes back, as he is usually quite conservative wrt API changes. |
There was a problem hiding this comment.
I don't like this as it does not to what it says. This is equivalent to if class_weight which is not the same as if not class_weight is None.
There was a problem hiding this comment.
I am not sure what you mean by your remark, @amueller . 'foo is not None' is the right way to ensure that the test is not triggered only by the 'None' value.
There was a problem hiding this comment.
Sorry, I have some trouble parsing your statement. My point is that ''False is not None'' is a false statement while ''not False is None'' is a true statement. Afaik.
Sorry, on mobile right now.
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
Gael Varoquaux [email protected] schrieb:
In sklearn/linear_model/stochastic_gradient.py:
@@ -449,7 +449,7 @@ def partial_fit(self, X, y, classes=None, > ------- > self : returns an instance of self. > """ > - if class_weight != None: > + if class_weight is not None:
I am not sure what you mean by your remark, @amueller . 'foo is not None' is the right way to ensure that the test is not triggered only by the 'None' value.
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
My point is that ''False is not None'' is a false statement while ''not False is None'' is a true statement.
In [1]: False is not None Out[1]: True In [2]: not False is None Out[2]: True
I think that the confusion comes from the fact that the Python
developers hacked the Python synthax for this to work.
There was a problem hiding this comment.
Seems I was wrong. A bit strange, though.
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
Gael Varoquaux [email protected] schrieb:
In sklearn/linear_model/stochastic_gradient.py:
@@ -449,7 +449,7 @@ def partial_fit(self, X, y, classes=None, > ------- > self : returns an instance of self. > """ > - if class_weight != None: > + if class_weight is not None:
I am not sure what you mean by your remark, @amueller . 'foo is not None' is the right way to ensure that the test is not triggered only by the 'None' value.
—
Reply to this email directly or view it on GitHub.
|
@ogrisel As you seem to do so reviewing atm, I'd love to have your opinion on this issue. |
|
As there seems to be no real opposition and if it is ok with @mblondel, I think we should merge. |
|
@ogrisel and @GaelVaroquaux haven't voiced their opinion yet :) |
+1 on Merge. |
|
+1 for consistent shapes across the project hence +1 for merging. |
|
i think we have enough +1 to merge - thanks for the feedback |
|
Thanks for the fix :) |
Changes shape of
SGDClassifier.predict_probato 2d array.This PR adresses #1023
In addition, cosmit in the sgd documentation