DOC add example to tree.ExtraTreeClassifier
@@ -1477,6 +1477,21 @@ class ExtraTreeClassifier(DecisionTreeClassifier):
.. [1] P. Geurts, D. Ernst., and L. Wehenkel, "Extremely randomized trees",
Machine Learning, 63(1), 3-42, 2006.
+
+ Examples
+ --------
+ >>> from sklearn.datasets import load_iris
+ >>> from sklearn.model_selection import train_test_split
+ >>> from sklearn.ensemble import BaggingClassifier
+ >>> from sklearn.tree import ExtraTreeClassifier
+ >>> X, y = load_iris(return_X_y=True)
+ >>> X_train, X_test, y_train, y_test = train_test_split(
+ ... X, y, random_state=0)
+ >>> extra_tree = ExtraTreeClassifier(random_state=0)
+ >>> cls = BaggingClassifier(extra_tree, random_state=0).fit(
+ ... X_train, y_train)
+ >>> cls.score(X_test, y_test)
+ 0.8947...
"""
def __init__(self,
criterion="gini",
