costFunction for logitic regression has been implemented