af0d98898e2be517096c18335ab10b43b9fd461e,mlxtend/classifier/adaline.py,Adaline,fit,#Adaline#,42

Before Change


        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:
            self.thres_ = 0
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: rasbt/mlxtend
Commit Name: af0d98898e2be517096c18335ab10b43b9fd461e
Time: 2015-03-17
Author: se.raschka@me.com
File Name: mlxtend/classifier/adaline.py
Class Name: Adaline
Method Name: fit


Project Name: rasbt/mlxtend
Commit Name: af0d98898e2be517096c18335ab10b43b9fd461e
Time: 2015-03-17
Author: se.raschka@me.com
File Name: mlxtend/classifier/perceptron.py
Class Name: Perceptron
Method Name: fit


Project Name: pymanopt/pymanopt
Commit Name: 8c5c5e9835e5720142871ff6f1be4561b66887da
Time: 2020-01-26
Author: niklas.koep@gmail.com
File Name: pymanopt/autodiff/backends/_autograd.py
Class Name: AutogradBackend
Method Name: is_compatible