f7e9f59ba8ab154067565560cc5040f31df928f5,mlxtend/classifier/perceptron.py,Perceptron,fit,#Perceptron#,47

Before Change



        
        // check array shape
        if not len(X.shape) == 2:
            raise ValueError("X must be a 2D array. Try X[:,np.newaxis]")

        // check if {0, 1} or {-1, 1} class labels are used
        self.classes_ = np.unique(y)
        if not (np.all(np.array([0, 1]) == self.classes_) or
                np.all(np.array([-1, 1]) == self.classes_)):
            raise ValueError("Only supports binary"

After Change


                self.w_[0] += update
                errors += int(update != 0.0)

            if self.print_progress:
                self._print_progress(epoch=i+1, cost=errors)
            self.cost_.append(errors)
        return self

    def _init_weights(self, shape):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: rasbt/mlxtend
Commit Name: f7e9f59ba8ab154067565560cc5040f31df928f5
Time: 2016-02-22
Author: mail@sebastianraschka.com
File Name: mlxtend/classifier/perceptron.py
Class Name: Perceptron
Method Name: fit


Project Name: rasbt/mlxtend
Commit Name: f7e9f59ba8ab154067565560cc5040f31df928f5
Time: 2016-02-22
Author: mail@sebastianraschka.com
File Name: mlxtend/classifier/adaline.py
Class Name: Adaline
Method Name: fit


Project Name: rasbt/mlxtend
Commit Name: f7e9f59ba8ab154067565560cc5040f31df928f5
Time: 2016-02-22
Author: mail@sebastianraschka.com
File Name: mlxtend/classifier/logistic_regression.py
Class Name: LogisticRegression
Method Name: fit