'Fit a binary classifier on X and y.'

def _fit_binary(self, X, y, alpha, C, sample_weight, learning_rate, max_iter):

    (coef, intercept, n_iter_) = fit_binary(self, 1, X, y, alpha, C, learning_rate, max_iter, self._expanded_class_weight[1], self._expanded_class_weight[0], sample_weight)
    self.t_ += (n_iter_ * X.shape[0])
    self.n_iter_ = n_iter_
    if (self.average > 0):
        if (self.average <= (self.t_ - 1)):
            self.coef_ = self.average_coef_.reshape(1, (-1))
            self.intercept_ = self.average_intercept_
        else:
            self.coef_ = self.standard_coef_.reshape(1, (-1))
            self.standard_intercept_ = np.atleast_1d(intercept)
            self.intercept_ = self.standard_intercept_
    else:
        self.coef_ = coef.reshape(1, (-1))
        self.intercept_ = np.atleast_1d(intercept)
