Skip to content

Commit 7b7ef97

Browse files
committed
Fix formatting in test_ensemble_vote_classifier
1 parent 08b603f commit 7b7ef97

6 files changed

Lines changed: 8 additions & 12 deletions

File tree

docs/sources/user_guide/feature_selection/ExhaustiveFeatureSelector.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,8 +1113,7 @@
11131113
"from sklearn.linear_model import LogisticRegression\n",
11141114
"from mlxtend.feature_selection import ExhaustiveFeatureSelector as EFS\n",
11151115
"\n",
1116-
"lr = LogisticRegression( solver='newton-cg', \n",
1117-
" random_state=123)\n",
1116+
"lr = LogisticRegression( solver='newton-cg',random_state=123)\n",
11181117
"\n",
11191118
"efs1 = EFS(estimator=lr, \n",
11201119
" min_features=2,\n",

docs/sources/user_guide/plotting/plot_decision_regions.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
},
149149
{
150150
"cell_type": "code",
151-
"execution_count": 2,
151+
"execution_count": null,
152152
"metadata": {},
153153
"outputs": [],
154154
"source": [
@@ -160,8 +160,7 @@
160160
"import numpy as np\n",
161161
"\n",
162162
"# Initializing Classifiers\n",
163-
"clf1 = LogisticRegression(random_state=1,\n",
164-
" solver='newton-cg')\n",
163+
"clf1 = LogisticRegression(random_state=1, solver='newton-cg')\n",
165164
"clf2 = RandomForestClassifier(random_state=1, n_estimators=100)\n",
166165
"clf3 = GaussianNB()\n",
167166
"clf4 = SVC(gamma='auto')\n",

mlxtend/classifier/perceptron.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _fit(self, X, y, init_params=True):
8585
update = self.eta * (y_data[idx] - self._to_classlabels(X[idx]))
8686
self.w_ += (update * X[idx]).reshape(self.w_.shape)
8787
self.b_ += update
88-
errors += int(update != 0.0)
88+
errors += int(np.any(update != 0.0))
8989

9090
if self.print_progress:
9191
self._print_progress(iteration=i + 1, n_iter=self.epochs, cost=errors)

mlxtend/classifier/tests/test_ensemble_vote_classifier.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ def test_no_weight_support_with_no_weight():
133133

134134

135135
def test_1model_labels():
136-
clf = LogisticRegression(solver="newton-cg", random_state=123
137-
)
136+
clf = LogisticRegression(solver="newton-cg", random_state=123)
138137
ens_clf_1 = EnsembleVoteClassifier(clfs=[clf], voting="soft", weights=None)
139138
ens_clf_2 = EnsembleVoteClassifier(clfs=[clf], voting="soft", weights=[1.0])
140139

@@ -147,8 +146,7 @@ def test_1model_labels():
147146

148147

149148
def test_1model_probas():
150-
clf = LogisticRegression(solver="newton-cg", random_state=123
151-
)
149+
clf = LogisticRegression(solver="newton-cg", random_state=123)
152150
ens_clf_1 = EnsembleVoteClassifier(clfs=[clf], voting="soft", weights=None)
153151
ens_clf_2 = EnsembleVoteClassifier(clfs=[clf], voting="soft", weights=[1.0])
154152

mlxtend/feature_selection/tests/test_exhaustive_feature_selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def _fit(self, X, y, init_params=True):
382382
update = self.eta * (y_data[idx] - self._to_classlabels(X[idx]))
383383
self.w_ += (update * X[idx]).reshape(self.w_.shape)
384384
self.b_ += update
385-
errors += int(update != 0.0)
385+
errors += int(np.any(update != 0.0))
386386

387387
if self.print_progress:
388388
self._print_progress(

mlxtend/feature_selection/tests/test_sequential_feature_selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def _fit(self, X, y, init_params=True):
526526
update = self.eta * (y_data[idx] - self._to_classlabels(X[idx]))
527527
self.w_ += (update * X[idx]).reshape(self.w_.shape)
528528
self.b_ += update
529-
errors += int(update != 0.0)
529+
errors += int(np.any(update != 0.0))
530530

531531
if self.print_progress:
532532
self.print_progress(

0 commit comments

Comments
 (0)