af0d98898e2be517096c18335ab10b43b9fd461e,mlxtend/classifier/perceptron.py,Perceptron,fit,#Perceptron#,35

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):
            self.w_ = np.random.random(1 + X.shape[1])
        else:
            self.w_ = init_weights

After Change


                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
        else:
            self.thres_ = 0.5

        // initialize weights
        if not isinstance(init_weights, np.ndarray):
            self.w_ = np.random.random(1 + X.shape[1])
        else:
            self.w_ = init_weights
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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: 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: suavecode/SUAVE
Commit Name: 0fca8ff2c499bd59764bda70790d0589ed6c6f89
Time: 2016-09-08
Author: ebotero@stanford.edu
File Name: trunk/SUAVE/Components/Energy/Converters/Turbine.py
Class Name: Turbine
Method Name: compute