# Can you use only the first summation term of cost function for typical logistic regression?

I have recently come across a Matlab implementation that appears to be using only the first term (i.e. in itself a product) of the typical logistic regression cost function.

f = - full(mean(sum(Y.*log(Yr))));
f = f + 0.5*lambda*sum(W(:).^2);


When I create a two class simple dataset and adjust the cost function to its traditional form I still get separation between classes albeit the vector of parameters are slightly different (for a fixed lambda regularizer in both cases).

f = - full(mean(sum(Y.*log(Yr) + (1-Y).*log(1-Yr))));
f = f + 0.5*lambda*sum(W(:).^2);


For better visualization see the following plot

Once the cost function is set, the parameters are learned using limited-memory BFGS. Gradient functions remain the same (i.e. derived from the correct classical cost function).

Naturally, my question is: Has this choice been deliberate ? Is the first objective function sufficient ? Or is it just an obvious inconsistency.