def METHOD_NAME(self, X, y, init_params=True):
    self._check_target_array(y, allowed={(0, 1)})
    y_data = np.where(y == 0, -1.0, 1.0)
    if init_params:
        self.b_, self.w_ = self._init_params(
            weights_shape=(X.shape[1], 1),
            bias_shape=(1,),
            random_seed=self.random_seed,
        )
        self.cost_ = []
    if self.minibatches is None:
        self.b_, self.w_ = self._normal_equation(X, y_data)
    # Gradient descent or stochastic gradient descent learning
    else:
        self.init_time_ = time()
        rgen = np.random.RandomState(self.random_seed)
        for i in range(self.epochs):
            for idx in self._yield_minibatches_idx(
                rgen=rgen, n_batches=self.minibatches, data_ary=y_data, shuffle=True
            ):
                y_val = self._net_input(X[idx])
                errors = y_data[idx] - y_val
                self.w_ += self.eta * X[idx].T.dot(errors).reshape(self.w_.shape)
                self.b_ += self.eta * errors.sum()
            cost = self._sum_squared_error_cost(y_data, self._net_input(X))
            self.cost_.append(cost)
            if self.print_progress:
                self._print_progress(
                    iteration=(i + 1), n_iter=self.epochs, cost=cost
                )
    return self