if not len(X.shape) == 2:
raise ValueError("X must be a 2D array. Try X[:,np.newaxis]")
if not (np.unique(y) == np.array([-1, 1])).all():
raise ValueError("Supports only binary class labels -1 and 1")
if not isinstance(init_weights, np.ndarray):
After Change
// check if {0, 1} or {-1, 1} class labels are used
self.classes_ = np.unique(y)
if not len(self.classes_) == 2 \
or not self.classes_[0] in (-1, 0) \
or not self.classes_[1] == 1:
raise ValueError("Only supports binary class labels {0, 1} or {-1, 1}.")
if self.classes_[0] == -1: