f7e9f59ba8ab154067565560cc5040f31df928f5,mlxtend/classifier/perceptron.py,Perceptron,fit,#Perceptron#Any#Any#Any#,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.cost_ = []
// learn weights
self.init_time_ = time()
for i in range(self.epochs):
if self.shuffle:
X, y = self._shuffle(X, y)
errors = 0
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
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/logistic_regression.py
Class Name: LogisticRegression
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