@larsmans, thanks a million! that was my blind spot in `MLP`. However one concern, I presume `linear` output activation is used in the case of binary classification since a score in the `decision_function` that is above `0` is rounded to class 1 and below zero is rounded to class `-1` which means its necessary that class `0` is labeled  as `-1` and the other as `1`. But, if there is a negative or zero value output, how would the `log` in cross-entropy work without causing math error? Because the loss function involves `Ti log(ai) + (1-Ti)log(1-ai)` where `ai` is the output and `Ti` is the actual labels. However, `ai` can be negative rendering the function invalid. Should there be some kind of scaling as a workaround?

Thanks @GaelVaroquaux , I will update the code as per your suggestion.