We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c7c502 commit 3caf6f0Copy full SHA for 3caf6f0
ch07/ch07.ipynb
ch07/ch07.py
@@ -179,9 +179,15 @@ def ensemble_error(n_classifier, error):
179
180
181
182
+# Scikit-learn 0.16 and newer requires reversing the parent classes
183
+# See https://github.com/rasbt/machine-learning-book/discussions/205 for more details
184
+import sklearn
185
+base_classes = (ClassifierMixin, BaseEstimator) if sklearn.__version__ >= "0.16" else (BaseEstimator, ClassifierMixin)
186
-class MajorityVoteClassifier(BaseEstimator,
- ClassifierMixin):
187
+# class MajorityVoteClassifier(BaseEstimator,
188
+# ClassifierMixin):
189
+
190
+class MajorityVoteClassifier(*base_classes):
191
""" A majority vote ensemble classifier
192
193
Parameters
0 commit comments