@GaelVaroquaux @agramfort  I know I shouldn't be confused here, but because this is the convention that I'm used to following (according to this link, http://math.stackexchange.com/questions/477207/derivative-of-cost-function-for-logistic-regression and Andrew Ng's lecture)

    If y > 0, i.e Loss is log(1 +  exp(-w^T * x) . and
    If y < 0,  Loss is  (w^T*x) + log(1 + exp(-w^T * x))

Let us take the case where w^T x is negative, and y is negative, the loss according to the code and the link that I've provided are clearly different, can you please clarify?