def _logistic_loss(w, X, y, alpha, sample_weight=None):
 (w, c, yz) = _intercept_dot(w, X, y)
 if (sample_weight is None):
  sample_weight = np.ones(y.shape[0])
 out = ((- np.sum((sample_weight * log_logistic(yz)))) + ((0.5 * alpha) * np.dot(w, w)))
 return out

def _logistic_loss ( w , X , y , alpha , sample_weight = None ) : ( w , c , yz ) = _intercept_dot ( w , X , y ) if ( sample_weight is None ) : sample_weight = np . ones ( y . shape [ 0 ] ) out = ( ( - np . sum ( ( sample_weight * log_logistic ( yz ) ) ) ) + ( ( 0.5 * alpha ) * np . dot ( w , w ) ) ) return out
computes the logistic loss .