[MRG + 1] MLP bug fixes and removing decision_function#5718
[MRG + 1] MLP bug fixes and removing decision_function#5718glennq wants to merge 1 commit intoscikit-learn:masterfrom
decision_function#5718Conversation
|
Thanks. I'm pretty busy with the release but I'll try to review soon. btw @kastnerkyle @ogrisel @eickenberg wdyt about removing |
|
I think doctest has failed because the way we use random_state changed. So coefficient initialization is slightly different. |
|
Ah, that's possible. But aren't the weights the first thing that is called with the RNG? Then you need to change the expected output of the doctest (as we just discussed ;) |
|
I checkout the commit just after changing use of random_state, and the failure still remains, so I am pretty sure now it's due to change in random state. I think the problem is that previously |
|
ah, ok. makes sense that it changed. |
decision_functiondecision_function
There was a problem hiding this comment.
why is this not needed anymore?
There was a problem hiding this comment.
We don't want to change the value of self.loss, and self.loss is actually only used once in _backprop at line 225 in the original code and 223 in the modified version, so I moved the logic of using 'binary_log_loss' instead of 'log_loss' for multilabel case to line 224-225
|
Apart from my comment LGTM. Thanks and sorry for the slow review. |
|
Can you please squash your commits? thanks. |
|
Could you also add a regression test that checks that the new multi-label behavior is correct that would have failed on the previous version? |
|
You mean the previous version that always uses |
|
Sorry for the long silence, I'll try to review this soon. |
decision_functiondecision_function
|
lgtm. @MechCoder wanna review? |
|
hi @amueller , just checking if someone's going to review this PR. |
| >>> clf.predict_proba([[2., 2.], [1., 2.]]) # doctest: +ELLIPSIS | ||
| array([[ 0., 1.], | ||
| [ 0., 1.]]) | ||
| array([[ 1.96718015e-04, 9.99803282e-01], |
|
Should this be done for the release? |
|
Probably should, since it's changing API of new code, especially given that On 11 September 2016 at 08:16, Manoj Kumar notifications@github.com wrote:
|
| in which a sample can belong to more than one class. For each class, the raw | ||
| output passes through the logistic function. Values larger or equal to `0.5` | ||
| are rounded to `1`, otherwise to `0`. For a predicted output of a sample, the | ||
| indices where the value is `1` represents the assigned classes of that sample:: |
There was a problem hiding this comment.
This is not tested in the multilabel test.
|
@glennq once my comments are addressed, can you please rebase on top of the current master? As we want to release 0.18rc quickly please let us know if you don't have the time to do that to day and one of us will take care of finishing this PR. |
|
Actually let me do it. |
|
@glennq you had a branch for dropout, right? |
|
@ogrisel Thank you for merging this fix! |
|
@glennq we don't need it for the release, but a PR would be nice so we can review. It's a great feature to have. |
|
@amueller Sure. Now that this one is merged, I'll make the dropout PR asap. |
|
@glennq sweet, thanks :) |
@amueller
Fix the wrong way of using random_state and mistakenly modifying parameter
loss. Some minor fixes and more tests also included.Remove decision_function to make the design, particularly with
_forward_passcleaner.BTW, I have already implemented dropout for MLP in my fork. I'm going to make a pull request for that once this one is merged.