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):
self.w_ = np.random.random(1 + X.shape[1])
else:
self.w_ = init_weights
After Change
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
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
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: anishathalye/neural-style
Commit Name: fcc43d79d2ea107c789d53424825ec9ffe8788f8
Time: 2018-11-23
Author: me@anishathalye.com
File Name: vgg.py
Class Name:
Method Name: load_net
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